Class PlayerEntity
java.lang.Object
org.geysermc.geyser.entity.type.Entity
org.geysermc.geyser.entity.type.LivingEntity
org.geysermc.geyser.entity.type.player.PlayerEntity
- Direct Known Subclasses:
SessionPlayerEntity,SkullPlayerEntity
-
Field Summary
FieldsFields inherited from class org.geysermc.geyser.entity.type.LivingEntity
boots, chestplate, hand, health, helmet, leggings, maxHealth, offHand -
Constructor Summary
ConstructorsConstructorDescriptionPlayerEntity(GeyserSession session, int entityId, long geyserId, com.github.steveice10.mc.auth.data.GameProfile gameProfile, com.nukkitx.math.vector.Vector3f position, com.nukkitx.math.vector.Vector3f motion, float yaw, float pitch, float headYaw) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidCalled on entity spawn.voidmoveAbsolute(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)voidvoidsetAbsorptionHearts(com.github.steveice10.mc.protocol.data.game.entity.metadata.type.FloatEntityMetadata entityMetadata)com.nukkitx.math.vector.Vector3isetBedPosition(com.github.steveice10.mc.protocol.data.game.entity.metadata.EntityMetadata<Optional<com.github.steveice10.mc.protocol.data.game.entity.metadata.Position>,?> entityMetadata)voidsetBelowNameText(Objective objective)protected voidsetDimensions(com.github.steveice10.mc.protocol.data.game.entity.metadata.Pose pose)Set the height and width of the entity's bounding boxvoidsetDisplayName(com.github.steveice10.mc.protocol.data.game.entity.metadata.EntityMetadata<Optional<net.kyori.adventure.text.Component>,?> entityMetadata)voidsetDisplayNameVisible(com.github.steveice10.mc.protocol.data.game.entity.metadata.type.BooleanEntityMetadata entityMetadata)voidsetLeftParrot(com.github.steveice10.mc.protocol.data.game.entity.metadata.EntityMetadata<com.github.steveice10.opennbt.tag.builtin.CompoundTag,?> entityMetadata)voidsetPosition(com.nukkitx.math.vector.Vector3f position)voidsetRightParrot(com.github.steveice10.mc.protocol.data.game.entity.metadata.EntityMetadata<com.github.steveice10.opennbt.tag.builtin.CompoundTag,?> entityMetadata)voidsetSkinVisibility(com.github.steveice10.mc.protocol.data.game.entity.metadata.type.ByteEntityMetadata entityMetadata)voidvoidupdateDisplayName(Team team, boolean useGivenTeam)voidupdateHeadLookRotation(float headYaw)Updates an entity's head position.voidupdatePositionAndRotation(double moveX, double moveY, double moveZ, float yaw, float pitch, boolean isOnGround)Updates an entity's position and rotation.voidupdateRotation(float yaw, float pitch, boolean isOnGround)Updates an entity's rotation.Methods inherited from class org.geysermc.geyser.entity.type.LivingEntity
calculateAttribute, checkInteractWithNameTag, createHealthAttribute, interact, isAlive, isShaking, setFreezing, setHealth, setLivingEntityFlags, updateArmor, updateAttribute, updateBedrockAttributes, updateMainHand, updateOffHandMethods inherited from class org.geysermc.geyser.entity.type.Entity
addAdditionalSpawnData, as, despawnEntity, getBedrockRotation, getFlag, getMaxAir, interactAt, moveAbsolute, moveRelative, playEntityEvent, playEntityEvent, setAir, setAirSupply, setBoundingBoxHeight, setBoundingBoxWidth, setFlag, setFlags, setGravity, setInvisible, setPose, setRiderSeatPosition, teleport, testInteraction, updateBedrockMetadata, updateInteractiveTag, updateMountOffset, updatePassengerOffsets
-
Field Details
-
SNEAKING_POSE_HEIGHT
public static final float SNEAKING_POSE_HEIGHT- See Also:
- Constant Field Values
-
-
Constructor Details
-
PlayerEntity
public PlayerEntity(GeyserSession session, int entityId, long geyserId, com.github.steveice10.mc.auth.data.GameProfile gameProfile, com.nukkitx.math.vector.Vector3f position, com.nukkitx.math.vector.Vector3f motion, float yaw, float pitch, float headYaw)
-
-
Method Details
-
initializeMetadata
protected void initializeMetadata()Description copied from class:EntityCalled on entity spawn. Used to populate the entity metadata and flags with default values.- Overrides:
initializeMetadatain classLivingEntity
-
spawnEntity
public void spawnEntity()- Overrides:
spawnEntityin classEntity
-
sendPlayer
public void sendPlayer() -
moveAbsolute
public void moveAbsolute(com.nukkitx.math.vector.Vector3f position, float yaw, float pitch, float headYaw, boolean isOnGround, boolean teleported)- Overrides:
moveAbsolutein classEntity
-
moveRelative
public void moveRelative(double relX, double relY, double relZ, float yaw, float pitch, float headYaw, boolean isOnGround)- Overrides:
moveRelativein classEntity
-
updateHeadLookRotation
public void updateHeadLookRotation(float headYaw)Description copied from class:EntityUpdates an entity's head position. Used in JavaRotateHeadTranslator.- Overrides:
updateHeadLookRotationin classEntity- Parameters:
headYaw- The new head rotation of the entity.
-
updatePositionAndRotation
public void updatePositionAndRotation(double moveX, double moveY, double moveZ, float yaw, float pitch, boolean isOnGround)Description copied from class:EntityUpdates an entity's position and rotation. Used in JavaMoveEntityPosRotTranslator.- Overrides:
updatePositionAndRotationin classEntity- Parameters:
moveX- 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.
-
updateRotation
public void updateRotation(float yaw, float pitch, boolean isOnGround)Description copied from class:EntityUpdates an entity's rotation. Used in JavaMoveEntityRotTranslator.- Overrides:
updateRotationin classEntity- Parameters:
yaw- The new yaw of the entity.pitch- The new pitch of the entity.isOnGround- Whether the entity is currently on the ground.
-
setPosition
public void setPosition(com.nukkitx.math.vector.Vector3f position) -
setBedPosition
public com.nukkitx.math.vector.Vector3i setBedPosition(com.github.steveice10.mc.protocol.data.game.entity.metadata.EntityMetadata<Optional<com.github.steveice10.mc.protocol.data.game.entity.metadata.Position>,?> entityMetadata)- Overrides:
setBedPositionin classLivingEntity
-
setAbsorptionHearts
public void setAbsorptionHearts(com.github.steveice10.mc.protocol.data.game.entity.metadata.type.FloatEntityMetadata entityMetadata) -
setSkinVisibility
public void setSkinVisibility(com.github.steveice10.mc.protocol.data.game.entity.metadata.type.ByteEntityMetadata entityMetadata) -
setLeftParrot
public void setLeftParrot(com.github.steveice10.mc.protocol.data.game.entity.metadata.EntityMetadata<com.github.steveice10.opennbt.tag.builtin.CompoundTag,?> entityMetadata) -
setRightParrot
public void setRightParrot(com.github.steveice10.mc.protocol.data.game.entity.metadata.EntityMetadata<com.github.steveice10.opennbt.tag.builtin.CompoundTag,?> entityMetadata) -
setDisplayName
public void setDisplayName(com.github.steveice10.mc.protocol.data.game.entity.metadata.EntityMetadata<Optional<net.kyori.adventure.text.Component>,?> entityMetadata)- Overrides:
setDisplayNamein classEntity
-
updateDisplayName
- Parameters:
useGivenTeam- even if there is no team, update the username in the entity metadata anyway, and don't look for a team
-
setDisplayNameVisible
public void setDisplayNameVisible(com.github.steveice10.mc.protocol.data.game.entity.metadata.type.BooleanEntityMetadata entityMetadata)- Overrides:
setDisplayNameVisiblein classEntity
-
setDimensions
protected void setDimensions(com.github.steveice10.mc.protocol.data.game.entity.metadata.Pose pose)Description copied from class:EntitySet the height and width of the entity's bounding box- Overrides:
setDimensionsin classLivingEntity
-
setBelowNameText
-