Package org.geysermc.geyser.entity.type
Class ItemEntity
java.lang.Object
org.geysermc.geyser.entity.type.Entity
org.geysermc.geyser.entity.type.ThrowableEntity
org.geysermc.geyser.entity.type.ItemEntity
- All Implemented Interfaces:
Tickable
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected com.nukkitx.protocol.bedrock.data.inventory.ItemDataFields inherited from class org.geysermc.geyser.entity.type.ThrowableEntity
lastJavaPosition -
Constructor Summary
ConstructorsConstructorDescriptionItemEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, com.nukkitx.math.vector.Vector3f position, com.nukkitx.math.vector.Vector3f motion, float yaw, float pitch, float headYaw) -
Method Summary
Modifier and TypeMethodDescriptionprotected floatgetDrag()protected floatGet the gravity of this entity type.protected booleanprotected voidmoveAbsoluteImmediate(com.nukkitx.math.vector.Vector3f position, float yaw, float pitch, float headYaw, boolean isOnGround, boolean teleported)voidsetItem(com.github.steveice10.mc.protocol.data.game.entity.metadata.EntityMetadata<com.github.steveice10.mc.protocol.data.game.entity.metadata.ItemStack,?> entityMetadata)voidvoidtick()Updates the position for the Bedrock client.Methods inherited from class org.geysermc.geyser.entity.type.ThrowableEntity
despawnEntity, moveAbsolute, moveRelativeMethods inherited from class org.geysermc.geyser.entity.type.Entity
addAdditionalSpawnData, as, getBedrockRotation, getFlag, getMaxAir, initializeMetadata, is, isShaking, moveAbsolute, moveRelative, setAir, setAirSupply, setBoundingBoxHeight, setBoundingBoxWidth, setDimensions, setDisplayName, setDisplayNameVisible, setFlag, setFlags, setFreezing, setGravity, setInvisible, setPose, setRiderSeatPosition, teleport, updateBedrockMetadata, updateHeadLookRotation, updatePositionAndRotation, updateRotation
-
Field Details
-
item
protected com.nukkitx.protocol.bedrock.data.inventory.ItemData item
-
-
Constructor Details
-
ItemEntity
public ItemEntity(GeyserSession session, long entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, com.nukkitx.math.vector.Vector3f position, com.nukkitx.math.vector.Vector3f motion, float yaw, float pitch, float headYaw)
-
-
Method Details
-
spawnEntity
public void spawnEntity()- Overrides:
spawnEntityin classEntity
-
tick
public void tick()Description copied from class:ThrowableEntityUpdates the position for the Bedrock client. Java clients assume the next positions of moving items. Bedrock needs to be explicitly told positions- Specified by:
tickin interfaceTickable- Overrides:
tickin classThrowableEntity
-
setItem
public void setItem(com.github.steveice10.mc.protocol.data.game.entity.metadata.EntityMetadata<com.github.steveice10.mc.protocol.data.game.entity.metadata.ItemStack,?> entityMetadata) -
moveAbsoluteImmediate
protected void moveAbsoluteImmediate(com.nukkitx.math.vector.Vector3f position, float yaw, float pitch, float headYaw, boolean isOnGround, boolean teleported)- Overrides:
moveAbsoluteImmediatein classThrowableEntity
-
getGravity
protected float getGravity()Description copied from class:ThrowableEntityGet the gravity of this entity type. Used for applying gravity while the entity is in motion.- Overrides:
getGravityin classThrowableEntity- Returns:
- the amount of gravity to apply to this entity while in motion.
-
getDrag
protected float getDrag()- Overrides:
getDragin classThrowableEntity- Returns:
- the drag that should be multiplied to the entity's motion
-
isInWater
protected boolean isInWater()- Overrides:
isInWaterin classThrowableEntity- Returns:
- true if this entity is currently in water.
-