public class Entity extends Object
| Modifier and Type | Field and Description |
|---|---|
protected Map<AttributeType,Attribute> |
attributes |
protected long |
entityId |
protected EntityType |
entityType |
protected long |
geyserId |
protected com.nukkitx.protocol.bedrock.data.entity.EntityDataMap |
metadata |
protected com.nukkitx.math.vector.Vector3f |
motion |
protected boolean |
onGround
Saves if the entity should be on the ground.
|
protected it.unimi.dsi.fastutil.longs.LongOpenHashSet |
passengers |
protected com.nukkitx.math.vector.Vector3f |
position |
protected com.nukkitx.math.vector.Vector3f |
rotation
x = Yaw, y = Pitch, z = HeadYaw
|
protected boolean |
valid |
| Constructor and Description |
|---|
Entity(long entityId,
long geyserId,
EntityType entityType,
com.nukkitx.math.vector.Vector3f position,
com.nukkitx.math.vector.Vector3f motion,
com.nukkitx.math.vector.Vector3f rotation) |
| Modifier and Type | Method and Description |
|---|---|
<I extends Entity> |
as(Class<I> entityClass) |
boolean |
despawnEntity(GeyserSession session)
Despawns the entity
|
com.nukkitx.math.vector.Vector3f |
getBedrockRotation()
x = Pitch, y = HeadYaw, z = Yaw
|
<I extends Entity> |
is(Class<I> entityClass) |
protected boolean |
isShaking(GeyserSession session)
If true, the entity should be shaking on the client's end.
|
void |
moveAbsolute(GeyserSession session,
com.nukkitx.math.vector.Vector3f position,
float yaw,
float pitch,
boolean isOnGround,
boolean teleported) |
void |
moveAbsolute(GeyserSession session,
com.nukkitx.math.vector.Vector3f position,
com.nukkitx.math.vector.Vector3f rotation,
boolean isOnGround,
boolean teleported) |
void |
moveRelative(GeyserSession session,
double relX,
double relY,
double relZ,
float yaw,
float pitch,
boolean isOnGround) |
void |
moveRelative(GeyserSession session,
double relX,
double relY,
double relZ,
com.nukkitx.math.vector.Vector3f rotation,
boolean isOnGround) |
protected void |
setDimensions(com.github.steveice10.mc.protocol.data.game.entity.metadata.Pose pose)
Set the height and width of the entity's bounding box
|
protected void |
setFreezing(GeyserSession session,
float amount)
Set a float from 0-1 - how strong the "frozen" overlay should be on screen.
|
void |
spawnEntity(GeyserSession session) |
void |
teleport(GeyserSession session,
com.nukkitx.math.vector.Vector3f position,
float yaw,
float pitch,
boolean isOnGround)
Teleports an entity to a new location.
|
void |
updateBedrockAttributes(GeyserSession session) |
void |
updateBedrockMetadata(com.github.steveice10.mc.protocol.data.game.entity.metadata.EntityMetadata entityMetadata,
GeyserSession session)
Applies the Java metadata to the local Bedrock metadata copy
|
void |
updateBedrockMetadata(GeyserSession session)
Sends the Bedrock metadata to the client
|
void |
updateHeadLookRotation(GeyserSession session,
float headYaw)
Updates an entity's head position.
|
void |
updatePositionAndRotation(GeyserSession session,
double moveX,
double moveY,
double moveZ,
float yaw,
float pitch,
boolean isOnGround)
Updates an entity's position and rotation.
|
void |
updateRotation(GeyserSession session,
float yaw,
float pitch,
boolean isOnGround)
Updates an entity's rotation.
|
protected long entityId
protected long geyserId
protected com.nukkitx.math.vector.Vector3f position
protected com.nukkitx.math.vector.Vector3f motion
protected com.nukkitx.math.vector.Vector3f rotation
protected boolean onGround
protected EntityType entityType
protected boolean valid
protected it.unimi.dsi.fastutil.longs.LongOpenHashSet passengers
protected Map<AttributeType,Attribute> attributes
protected com.nukkitx.protocol.bedrock.data.entity.EntityDataMap metadata
public Entity(long entityId,
long geyserId,
EntityType entityType,
com.nukkitx.math.vector.Vector3f position,
com.nukkitx.math.vector.Vector3f motion,
com.nukkitx.math.vector.Vector3f rotation)
public void spawnEntity(GeyserSession session)
public boolean despawnEntity(GeyserSession session)
session - The GeyserSessionpublic void moveRelative(GeyserSession session, double relX, double relY, double relZ, float yaw, float pitch, boolean isOnGround)
public void moveRelative(GeyserSession session, double relX, double relY, double relZ, com.nukkitx.math.vector.Vector3f rotation, boolean isOnGround)
public void moveAbsolute(GeyserSession session, com.nukkitx.math.vector.Vector3f position, float yaw, float pitch, boolean isOnGround, boolean teleported)
public void moveAbsolute(GeyserSession session, com.nukkitx.math.vector.Vector3f position, com.nukkitx.math.vector.Vector3f rotation, boolean isOnGround, boolean teleported)
public void teleport(GeyserSession session, com.nukkitx.math.vector.Vector3f position, float yaw, float pitch, boolean isOnGround)
session - GeyserSession.position - The new position of the entity.yaw - The new yaw of the entity.pitch - The new pitch of the entity.isOnGround - Whether the entity is currently on the ground.public void updateHeadLookRotation(GeyserSession session, float headYaw)
session - GeyserSession.headYaw - The new head rotation of the entity.public void updatePositionAndRotation(GeyserSession session, double moveX, double moveY, double moveZ, float yaw, float pitch, boolean isOnGround)
session - GeyserSessionmoveX - The new X offset of the current position.moveY - The new Y offset of the current position.moveZ - The new Z offset of the current position.yaw - The new yaw of the entity.pitch - The new pitch of the entity.isOnGround - Whether the entity is currently on the ground.public void updateRotation(GeyserSession session, float yaw, float pitch, boolean isOnGround)
session - GeyserSession.yaw - The new yaw of the entity.pitch - The new pitch of the entity.isOnGround - Whether the entity is currently on the ground.public void updateBedrockAttributes(GeyserSession session)
public void updateBedrockMetadata(com.github.steveice10.mc.protocol.data.game.entity.metadata.EntityMetadata entityMetadata,
GeyserSession session)
entityMetadata - the Java entity metadatasession - GeyserSessionpublic void updateBedrockMetadata(GeyserSession session)
session - GeyserSessionprotected boolean isShaking(GeyserSession session)
EntityFlag.SHAKING should be set to true.protected void setDimensions(com.github.steveice10.mc.protocol.data.game.entity.metadata.Pose pose)
protected void setFreezing(GeyserSession session, float amount)
public com.nukkitx.math.vector.Vector3f getBedrockRotation()
Copyright © 2021 GeyserMC. All rights reserved.