Package org.geysermc.geyser.entity.type
Class ThrowableEntity
java.lang.Object
org.geysermc.geyser.entity.type.Entity
org.geysermc.geyser.entity.type.ThrowableEntity
- All Implemented Interfaces:
Tickable
- Direct Known Subclasses:
FireballEntity,FishingHookEntity,ItemEntity,ThrowableItemEntity
Used as a class for any object-like entity that moves as a projectile
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionThrowableEntity(GeyserSession session, int 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 TypeMethodDescriptionbooleanDespawns the entityprotected floatgetDrag()protected floatGet the gravity of this entity type.protected booleanvoidmoveAbsolute(com.nukkitx.math.vector.Vector3f position, float yaw, float pitch, float headYaw, boolean isOnGround, boolean teleported)protected voidmoveAbsoluteImmediate(com.nukkitx.math.vector.Vector3f position, float yaw, float pitch, float headYaw, boolean isOnGround, boolean teleported)voidmoveRelative(double relX, double relY, double relZ, float yaw, float pitch, float headYaw, boolean isOnGround)voidtick()Updates the position for the Bedrock client.Methods 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, spawnEntity, teleport, updateBedrockMetadata, updateHeadLookRotation, updateMountOffset, updatePassengerOffsets, updatePositionAndRotation, updateRotation
-
Field Details
-
lastJavaPosition
protected com.nukkitx.math.vector.Vector3f lastJavaPosition
-
-
Constructor Details
-
ThrowableEntity
public ThrowableEntity(GeyserSession session, int 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
-
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 -
moveAbsoluteImmediate
protected void moveAbsoluteImmediate(com.nukkitx.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 boolean despawnEntity()Description copied from class:EntityDespawns the entity- Overrides:
despawnEntityin classEntity- Returns:
- can be deleted
-
moveRelative
public void moveRelative(double relX, double relY, double relZ, float yaw, float pitch, float headYaw, boolean isOnGround)- Overrides:
moveRelativein classEntity
-
moveAbsolute
public void moveAbsolute(com.nukkitx.math.vector.Vector3f position, float yaw, float pitch, float headYaw, boolean isOnGround, boolean teleported)- Overrides:
moveAbsolutein classEntity
-