Class PlayerEntity

Direct Known Subclasses:
SessionPlayerEntity, SkullPlayerEntity

public class PlayerEntity extends LivingEntity
  • Field Details

  • Constructor Details

    • PlayerEntity

      public PlayerEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, com.nukkitx.math.vector.Vector3f position, com.nukkitx.math.vector.Vector3f motion, float yaw, float pitch, float headYaw, String username, @Nullable String texturesProperty)
  • Method Details

    • initializeMetadata

      protected void initializeMetadata()
      Description copied from class: Entity
      Called on entity spawn. Used to populate the entity metadata and flags with default values.
      Overrides:
      initializeMetadata in class LivingEntity
    • spawnEntity

      public void spawnEntity()
      Overrides:
      spawnEntity in class Entity
    • 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:
      moveAbsolute in class Entity
    • moveRelative

      public void moveRelative(double relX, double relY, double relZ, float yaw, float pitch, float headYaw, boolean isOnGround)
      Overrides:
      moveRelative in class Entity
    • updateHeadLookRotation

      public void updateHeadLookRotation(float headYaw)
      Description copied from class: Entity
      Updates an entity's head position. Used in JavaRotateHeadTranslator.
      Overrides:
      updateHeadLookRotation in class Entity
      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: Entity
      Updates an entity's position and rotation. Used in JavaMoveEntityPosRotTranslator.
      Overrides:
      updatePositionAndRotation in class Entity
      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: Entity
      Updates an entity's rotation. Used in JavaMoveEntityRotTranslator.
      Overrides:
      updateRotation in class Entity
      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:
      setBedPosition in class LivingEntity
    • 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:
      setDisplayName in class Entity
    • updateDisplayName

      public void updateDisplayName(@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
    • setDisplayNameVisible

      public void setDisplayNameVisible(com.github.steveice10.mc.protocol.data.game.entity.metadata.type.BooleanEntityMetadata entityMetadata)
      Overrides:
      setDisplayNameVisible in class Entity
    • 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(Objective objective)