Package org.geysermc.connector.entity
Class ThrowableEntity
java.lang.Object
org.geysermc.connector.entity.Entity
org.geysermc.connector.entity.ThrowableEntity
- All Implemented Interfaces:
Tickable
- Direct Known Subclasses:
FishingHookEntity,ItemedFireballEntity,ItemEntity,ThrowableItemEntity
Used as a class for any object-like entity that moves as a projectile
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionThrowableEntity(long entityId, long geyserId, EntityType entityType, com.nukkitx.math.vector.Vector3f position, com.nukkitx.math.vector.Vector3f motion, com.nukkitx.math.vector.Vector3f rotation) -
Method Summary
Modifier and TypeMethodDescriptionbooleandespawnEntity(GeyserSession session)Despawns the entityprotected floatgetDrag(GeyserSession session)protected floatgetGravity(GeyserSession session)Get the gravity of this entity type.protected booleanisInWater(GeyserSession session)voidmoveAbsolute(GeyserSession session, com.nukkitx.math.vector.Vector3f position, com.nukkitx.math.vector.Vector3f rotation, boolean isOnGround, boolean teleported)protected voidmoveAbsoluteImmediate(GeyserSession session, com.nukkitx.math.vector.Vector3f position, com.nukkitx.math.vector.Vector3f rotation, boolean isOnGround, boolean teleported)voidmoveRelative(GeyserSession session, double relX, double relY, double relZ, com.nukkitx.math.vector.Vector3f rotation, boolean isOnGround)voidtick(GeyserSession session)Updates the position for the Bedrock client.Methods inherited from class org.geysermc.connector.entity.Entity
addAdditionalSpawnData, as, getBedrockRotation, getMaxAir, is, isShaking, moveAbsolute, moveRelative, setAir, setDimensions, setDisplayName, setDisplayNameVisible, setFreezing, setInvisible, spawnEntity, teleport, updateBedrockMetadata, updateBedrockMetadata, updateHeadLookRotation, updatePositionAndRotation, updateRotation
-
Field Details
-
lastJavaPosition
protected com.nukkitx.math.vector.Vector3f lastJavaPosition
-
-
Constructor Details
-
ThrowableEntity
public ThrowableEntity(long entityId, long geyserId, EntityType entityType, com.nukkitx.math.vector.Vector3f position, com.nukkitx.math.vector.Vector3f motion, com.nukkitx.math.vector.Vector3f rotation)
-
-
Method Details
-
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(GeyserSession session, com.nukkitx.math.vector.Vector3f position, com.nukkitx.math.vector.Vector3f rotation, boolean isOnGround, boolean teleported) -
getGravity
Get the gravity of this entity type. Used for applying gravity while the entity is in motion.- Parameters:
session- the session of the Bedrock client.- Returns:
- the amount of gravity to apply to this entity while in motion.
-
getDrag
- Parameters:
session- the session of the Bedrock client.- Returns:
- the drag that should be multiplied to the entity's motion
-
isInWater
- Parameters:
session- the session of the Bedrock client.- Returns:
- true if this entity is currently in water.
-
despawnEntity
Description copied from class:EntityDespawns the entity- Overrides:
despawnEntityin classEntity- Parameters:
session- The GeyserSession- Returns:
- can be deleted
-
moveRelative
public void moveRelative(GeyserSession session, double relX, double relY, double relZ, com.nukkitx.math.vector.Vector3f rotation, boolean isOnGround)- Overrides:
moveRelativein classEntity
-
moveAbsolute
public void moveAbsolute(GeyserSession session, com.nukkitx.math.vector.Vector3f position, com.nukkitx.math.vector.Vector3f rotation, boolean isOnGround, boolean teleported)- Overrides:
moveAbsolutein classEntity
-