Class PlayerEntity
java.lang.Object
org.geysermc.connector.entity.Entity
org.geysermc.connector.entity.LivingEntity
org.geysermc.connector.entity.player.PlayerEntity
- Direct Known Subclasses:
SessionPlayerEntity,SkullPlayerEntity
-
Field Summary
Fields inherited from class org.geysermc.connector.entity.LivingEntity
boots, chestplate, hand, health, helmet, leggings, maxHealth, offHand -
Constructor Summary
ConstructorsConstructorDescriptionPlayerEntity(com.github.steveice10.mc.auth.data.GameProfile gameProfile, long entityId, long geyserId, com.nukkitx.math.vector.Vector3f position, com.nukkitx.math.vector.Vector3f motion, com.nukkitx.math.vector.Vector3f rotation) -
Method Summary
Modifier and TypeMethodDescriptionvoidmoveAbsolute(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)voidsendPlayer(GeyserSession session)voidsetBelowNameText(GeyserSession session, 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 boxprotected voidsetDisplayName(GeyserSession session, net.kyori.adventure.text.Component name)protected voidsetDisplayNameVisible(com.github.steveice10.mc.protocol.data.game.entity.metadata.EntityMetadata entityMetadata)voidsetPosition(com.nukkitx.math.vector.Vector3f position)voidspawnEntity(GeyserSession session)voidupdateBedrockMetadata(com.github.steveice10.mc.protocol.data.game.entity.metadata.EntityMetadata entityMetadata, GeyserSession session)Applies the Java metadata to the local Bedrock metadata copyvoidupdateDisplayName(GeyserSession session, Team team, boolean useGivenTeam)voidupdateHeadLookRotation(GeyserSession session, float headYaw)Updates an entity's head position.voidupdatePositionAndRotation(GeyserSession session, double moveX, double moveY, double moveZ, float yaw, float pitch, boolean isOnGround)Updates an entity's position and rotation.voidupdateRotation(GeyserSession session, float yaw, float pitch, boolean isOnGround)Updates an entity's rotation.Methods inherited from class org.geysermc.connector.entity.LivingEntity
calculateAttribute, createHealthAttribute, isShaking, setFreezing, updateArmor, updateAttribute, updateBedrockAttributes, updateMainHand, updateOffHandMethods inherited from class org.geysermc.connector.entity.Entity
addAdditionalSpawnData, as, despawnEntity, getBedrockRotation, getMaxAir, is, moveAbsolute, moveRelative, setAir, setInvisible, teleport, updateBedrockMetadata
-
Constructor Details
-
PlayerEntity
public PlayerEntity(com.github.steveice10.mc.auth.data.GameProfile gameProfile, long entityId, long geyserId, com.nukkitx.math.vector.Vector3f position, com.nukkitx.math.vector.Vector3f motion, com.nukkitx.math.vector.Vector3f rotation)
-
-
Method Details
-
spawnEntity
- Overrides:
spawnEntityin classEntity
-
sendPlayer
-
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
-
moveRelative
public void moveRelative(GeyserSession session, double relX, double relY, double relZ, com.nukkitx.math.vector.Vector3f rotation, boolean isOnGround)- Overrides:
moveRelativein classEntity
-
updateHeadLookRotation
Description copied from class:EntityUpdates an entity's head position. Used in JavaEntityHeadLookTranslator.- Overrides:
updateHeadLookRotationin classEntity- Parameters:
session- GeyserSession.headYaw- The new head rotation of the entity.
-
updatePositionAndRotation
public void updatePositionAndRotation(GeyserSession session, 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 JavaEntityPositionRotationTranslator.- Overrides:
updatePositionAndRotationin classEntity- Parameters:
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.
-
updateRotation
Description copied from class:EntityUpdates an entity's rotation. Used in JavaEntityRotationTranslator.- Overrides:
updateRotationin classEntity- Parameters:
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.
-
setPosition
public void setPosition(com.nukkitx.math.vector.Vector3f position) -
updateBedrockMetadata
public void updateBedrockMetadata(com.github.steveice10.mc.protocol.data.game.entity.metadata.EntityMetadata entityMetadata, GeyserSession session)Description copied from class:EntityApplies the Java metadata to the local Bedrock metadata copy- Overrides:
updateBedrockMetadatain classLivingEntity- Parameters:
entityMetadata- the Java entity metadatasession- GeyserSession
-
setDisplayName
- 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
protected void setDisplayNameVisible(com.github.steveice10.mc.protocol.data.game.entity.metadata.EntityMetadata 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
-