Class ItemEntity

All Implemented Interfaces:
Tickable

public class ItemEntity extends ThrowableEntity
  • 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:
      spawnEntity in class Entity
    • tick

      public void tick()
      Description copied from class: ThrowableEntity
      Updates the position for the Bedrock client. Java clients assume the next positions of moving items. Bedrock needs to be explicitly told positions
      Specified by:
      tick in interface Tickable
      Overrides:
      tick in class ThrowableEntity
    • 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:
      moveAbsoluteImmediate in class ThrowableEntity
    • getGravity

      protected float getGravity()
      Description copied from class: ThrowableEntity
      Get the gravity of this entity type. Used for applying gravity while the entity is in motion.
      Overrides:
      getGravity in class ThrowableEntity
      Returns:
      the amount of gravity to apply to this entity while in motion.
    • getDrag

      protected float getDrag()
      Overrides:
      getDrag in class ThrowableEntity
      Returns:
      the drag that should be multiplied to the entity's motion
    • isInWater

      protected boolean isInWater()
      Overrides:
      isInWater in class ThrowableEntity
      Returns:
      true if this entity is currently in water.