Class PlayerEntity

All Implemented Interfaces:
org.geysermc.geyser.api.entity.type.GeyserEntity, org.geysermc.geyser.api.entity.type.player.GeyserPlayerEntity
Direct Known Subclasses:
SessionPlayerEntity, SkullPlayerEntity

public class PlayerEntity extends LivingEntity implements org.geysermc.geyser.api.entity.type.player.GeyserPlayerEntity
  • Field Details

    • SNEAKING_POSE_HEIGHT

      public static final float SNEAKING_POSE_HEIGHT
      See Also:
    • BASE_ABILITY_LAYER

      protected static final List<org.cloudburstmc.protocol.bedrock.data.AbilityLayer> BASE_ABILITY_LAYER
  • Constructor Details

    • PlayerEntity

      public PlayerEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, org.cloudburstmc.math.vector.Vector3f position, org.cloudburstmc.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
    • despawnEntity

      public void despawnEntity()
      Description copied from class: Entity
      Despawns the entity
      Overrides:
      despawnEntity in class Entity
    • resetMetadata

      public void resetMetadata()
    • sendPlayer

      public void sendPlayer()
    • moveAbsolute

      public void moveAbsolute(org.cloudburstmc.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 LivingEntity
    • updateRotation

      public void updateRotation(float yaw, float pitch, float headYaw, boolean isOnGround)
    • setPosition

      public void setPosition(org.cloudburstmc.math.vector.Vector3f position)
      Overrides:
      setPosition in class Entity
    • setBedPosition

      public @Nullable org.cloudburstmc.math.vector.Vector3i setBedPosition(org.geysermc.mcprotocollib.protocol.data.game.entity.metadata.EntityMetadata<Optional<org.cloudburstmc.math.vector.Vector3i>,?> entityMetadata)
      Overrides:
      setBedPosition in class LivingEntity
    • setAbsorptionHearts

      public void setAbsorptionHearts(org.geysermc.mcprotocollib.protocol.data.game.entity.metadata.type.FloatEntityMetadata entityMetadata)
    • setSkinVisibility

      public void setSkinVisibility(org.geysermc.mcprotocollib.protocol.data.game.entity.metadata.type.ByteEntityMetadata entityMetadata)
    • setLeftParrot

      public void setLeftParrot(org.geysermc.mcprotocollib.protocol.data.game.entity.metadata.EntityMetadata<org.cloudburstmc.nbt.NbtMap,?> entityMetadata)
    • setRightParrot

      public void setRightParrot(org.geysermc.mcprotocollib.protocol.data.game.entity.metadata.EntityMetadata<org.cloudburstmc.nbt.NbtMap,?> entityMetadata)
    • setParrot

      protected void setParrot(org.cloudburstmc.nbt.NbtMap tag, boolean isLeft)
      Sets the parrot occupying the shoulder. Bedrock Edition requires a full entity whereas Java Edition just spawns it from the NBT data provided
    • getDisplayName

      public String getDisplayName()
      Overrides:
      getDisplayName in class Entity
    • setDisplayName

      public void setDisplayName(org.geysermc.mcprotocollib.protocol.data.game.entity.metadata.EntityMetadata<Optional<net.kyori.adventure.text.Component>,?> entityMetadata)
      Overrides:
      setDisplayName in class Entity
    • teamIdentifier

      public String teamIdentifier()
      Overrides:
      teamIdentifier in class Entity
    • setNametag

      protected void setNametag(@Nullable String nametag, boolean fromDisplayName)
      Overrides:
      setNametag in class Entity
    • setDisplayNameVisible

      public void setDisplayNameVisible(org.geysermc.mcprotocollib.protocol.data.game.entity.metadata.type.BooleanEntityMetadata entityMetadata)
      Overrides:
      setDisplayNameVisible in class Entity
    • setBelowNameText

      public void setBelowNameText(String text)
    • scoreVisibility

      protected void scoreVisibility(boolean show)
      Overrides:
      scoreVisibility in class Entity
    • setDimensions

      protected void setDimensions(org.geysermc.mcprotocollib.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
    • getTabListUuid

      public UUID getTabListUuid()
      Returns:
      the UUID that should be used when dealing with Bedrock's tab list.
    • position

      public org.cloudburstmc.math.vector.Vector3f position()
      Specified by:
      position in interface org.geysermc.geyser.api.entity.type.player.GeyserPlayerEntity
    • getUsername

      public String getUsername()
    • getCachedScore

      public String getCachedScore()
    • isScoreVisible

      public boolean isScoreVisible()
    • getTexturesProperty

      public @Nullable String getTexturesProperty()
      The textures property from the GameProfile.
    • getBedPosition

      public @Nullable org.cloudburstmc.math.vector.Vector3i getBedPosition()
    • getLeftParrot

      public ParrotEntity getLeftParrot()
      Saves the parrot currently on the player's left shoulder; otherwise null
    • getRightParrot

      public ParrotEntity getRightParrot()
      Saves the parrot currently on the player's right shoulder; otherwise null
    • setUsername

      public void setUsername(String username)
    • setCachedScore

      public void setCachedScore(String cachedScore)
    • setScoreVisible

      public void setScoreVisible(boolean scoreVisible)
    • setTexturesProperty

      public void setTexturesProperty(@Nullable String texturesProperty)
      The textures property from the GameProfile.