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:
org.geysermc.geyser.api.entity.type.GeyserEntity,Tickable
- Direct Known Subclasses:
FireballEntity,FishingHookEntity,ItemEntity,ThrowableItemEntity
Used as a class for any object-like entity that moves as a projectile
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.cloudburstmc.math.vector.Vector3fFields inherited from class org.geysermc.geyser.entity.type.Entity
definition, dirtyMetadata, displayName, entityId, flags, geyserId, headYaw, motion, nametag, onGround, passengers, pitch, position, propertyManager, session, silent, uuid, valid, vehicle, yaw -
Constructor Summary
ConstructorsConstructorDescriptionThrowableEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, org.cloudburstmc.math.vector.Vector3f position, org.cloudburstmc.math.vector.Vector3f motion, float yaw, float pitch, float headYaw) -
Method Summary
Modifier and TypeMethodDescriptionvoidDespawns the entityprotected floatgetDrag()protected floatGet the gravity of this entity type.protected booleanvoidmoveAbsolute(org.cloudburstmc.math.vector.Vector3f position, float yaw, float pitch, float headYaw, boolean isOnGround, boolean teleported) protected voidmoveAbsoluteImmediate(org.cloudburstmc.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) booleanRemoves the entity if it is 64 blocks below the world.voidtick()Updates the position for the Bedrock client.Methods inherited from class org.geysermc.geyser.entity.type.Entity
addAdditionalSpawnData, doesJumpDismount, getBedrockRotation, getBoundingBoxHeight, getBoundingBoxWidth, getDefinition, getDirtyMetadata, getDisplayName, getEntityId, getFlag, getGeyserId, getHeadYaw, getMaxAir, getMotion, getNametag, getPassengers, getPitch, getPosition, getPropertyManager, getSession, getUuid, getVehicle, getYaw, hasLeashesToDrop, initializeMetadata, interact, interactAt, isAlive, isOnGround, isShaking, isSilent, isValid, javaId, moveAbsolute, moveRelative, playEntityEvent, playEntityEvent, scoreVisibility, setAir, setAirSupply, setBoundingBoxHeight, setBoundingBoxWidth, setClientSideSilent, setDefinition, setDimensionsFromPose, setDisplayName, setDisplayNameVisible, setEntityId, setFlag, setFlags, setFlagsDirty, setFreezing, setGliding, setGravity, setHeadYaw, setInvisible, setMotion, setNametag, setOnGround, setPassengers, setPitch, setPose, setPosition, setRiderSeatPosition, setSilent, setSneaking, setSprinting, setUuid, setValid, setVehicle, setYaw, spawnEntity, standardDisplayName, teamIdentifier, teleport, testInteraction, updateBedrockEntityProperties, updateBedrockMetadata, updateHeadLookRotation, updateInteractiveTag, updateMountOffset, updateNametag, updateNametag, updatePassengerOffsets, updatePositionAndRotation, updatePropertiesBatched, updateRotationMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.geysermc.geyser.api.entity.type.GeyserEntity
updateProperty
-
Field Details
-
lastJavaPosition
protected org.cloudburstmc.math.vector.Vector3f lastJavaPosition
-
-
Constructor Details
-
ThrowableEntity
public ThrowableEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, org.cloudburstmc.math.vector.Vector3f position, org.cloudburstmc.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(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:EntityDespawns the entity- Overrides:
despawnEntityin classEntity
-
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(org.cloudburstmc.math.vector.Vector3f position, float yaw, float pitch, float headYaw, boolean isOnGround, boolean teleported) - Overrides:
moveAbsolutein classEntity
-
removedInVoid
public boolean removedInVoid()Removes the entity if it is 64 blocks below the world.- Returns:
- true if the entity was removed
-