Class PlayerEntity

Direct Known Subclasses:
SessionPlayerEntity, SkullPlayerEntity

public class PlayerEntity extends LivingEntity
  • 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

      public void spawnEntity(GeyserSession session)
      Overrides:
      spawnEntity in class Entity
    • sendPlayer

      public void sendPlayer(GeyserSession session)
    • moveAbsolute

      public void moveAbsolute(GeyserSession session, com.nukkitx.math.vector.Vector3f position, com.nukkitx.math.vector.Vector3f rotation, boolean isOnGround, boolean teleported)
      Overrides:
      moveAbsolute in class Entity
    • moveRelative

      public void moveRelative(GeyserSession session, double relX, double relY, double relZ, com.nukkitx.math.vector.Vector3f rotation, boolean isOnGround)
      Overrides:
      moveRelative in class Entity
    • updateHeadLookRotation

      public void updateHeadLookRotation(GeyserSession session, float headYaw)
      Description copied from class: Entity
      Updates an entity's head position. Used in JavaEntityHeadLookTranslator.
      Overrides:
      updateHeadLookRotation in class Entity
      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: Entity
      Updates an entity's position and rotation. Used in JavaEntityPositionRotationTranslator.
      Overrides:
      updatePositionAndRotation in class Entity
      Parameters:
      session - GeyserSession
      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(GeyserSession session, float yaw, float pitch, boolean isOnGround)
      Description copied from class: Entity
      Updates an entity's rotation. Used in JavaEntityRotationTranslator.
      Overrides:
      updateRotation in class Entity
      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: Entity
      Applies the Java metadata to the local Bedrock metadata copy
      Overrides:
      updateBedrockMetadata in class LivingEntity
      Parameters:
      entityMetadata - the Java entity metadata
      session - GeyserSession
    • setDisplayName

      protected String setDisplayName(GeyserSession session, net.kyori.adventure.text.Component name)
      Overrides:
      setDisplayName in class Entity
      Returns:
      the translated string display
    • updateDisplayName

      public void updateDisplayName(GeyserSession session, @Nullable Team team, boolean useGivenTeam)
      Parameters:
      useGivenTeam - even if there is no team, update the username in the entity metadata anyway, and don't look for a team
    • setDimensions

      protected void setDimensions(com.github.steveice10.mc.protocol.data.game.entity.metadata.Pose pose)
      Description copied from class: Entity
      Set the height and width of the entity's bounding box
      Overrides:
      setDimensions in class LivingEntity
    • setBelowNameText

      public void setBelowNameText(GeyserSession session, Objective objective)