Class ThrowableEntity

java.lang.Object
org.geysermc.geyser.entity.type.Entity
org.geysermc.geyser.entity.type.ThrowableEntity
All Implemented Interfaces:
org.geysermc.geyser.api.entity.type.GeyserEntity, Tickable
Direct Known Subclasses:
FireballEntity, FishingHookEntity, ItemEntity, ThrowableItemEntity

public class ThrowableEntity extends Entity implements Tickable
Used as a class for any object-like entity that moves as a projectile
  • Field Details

    • lastJavaPosition

      protected org.cloudburstmc.math.vector.Vector3f lastJavaPosition
  • Constructor Details

  • Method Details

    • tick

      public void tick()
      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
    • moveAbsoluteImmediate

      protected void moveAbsoluteImmediate(org.cloudburstmc.math.vector.Vector3f position, float yaw, float pitch, float headYaw, boolean isOnGround, boolean teleported)
    • getGravity

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

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

      protected boolean isInWater()
      Returns:
      true if this entity is currently in water.
    • despawnEntity

      public void despawnEntity()
      Description copied from class: Entity
      Despawns the entity
      Overrides:
      despawnEntity in class Entity
    • moveRelativeRaw

      public void moveRelativeRaw(double relX, double relY, double relZ, float yaw, float pitch, float headYaw, boolean isOnGround)
      Overrides:
      moveRelativeRaw in class Entity
    • moveAbsoluteRaw

      public void moveAbsoluteRaw(org.cloudburstmc.math.vector.Vector3f position, float yaw, float pitch, float headYaw, boolean isOnGround, boolean teleported)
      Overrides:
      moveAbsoluteRaw in class Entity
    • removedInVoid

      public boolean removedInVoid()
      Removes the entity if it is 64 blocks below the world.
      Returns:
      true if the entity was removed