Class PlayerEntity
java.lang.Object
org.geysermc.geyser.entity.type.Entity
org.geysermc.geyser.entity.type.LivingEntity
org.geysermc.geyser.entity.type.player.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 Summary
FieldsModifier and TypeFieldDescriptionprotected static final List<org.cloudburstmc.protocol.bedrock.data.AbilityLayer>static final floatFields inherited from class org.geysermc.geyser.entity.type.LivingEntity
body, boots, chestplate, equipment, hand, health, helmet, leggings, maxHealth, offhand, saddleFields inherited from class org.geysermc.geyser.entity.type.Entity
definition, dirtyMetadata, entityId, flags, geyserId, headYaw, motion, nametag, onGround, passengers, pitch, position, propertyManager, session, silent, uuid, valid, vehicle, yaw -
Constructor Summary
ConstructorsConstructorDescriptionPlayerEntity(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 Summary
Modifier and TypeMethodDescriptionvoidDespawns the entity@Nullable org.cloudburstmc.math.vector.Vector3i@Nullable ParrotEntitySaves the parrot currently on the player's left shoulder; otherwise null@Nullable ParrotEntitySaves the parrot currently on the player's right shoulder; otherwise null@Nullable StringThe textures property from the GameProfile.protected voidCalled on entity spawn.booleanisListed()Whether this player is currently listed.booleanvoidmoveAbsolute(org.cloudburstmc.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) org.cloudburstmc.math.vector.Vector3fposition()voidprotected voidscoreVisibility(boolean show) voidvoidsetAbsorptionHearts(org.geysermc.mcprotocollib.protocol.data.game.entity.metadata.type.FloatEntityMetadata entityMetadata) @Nullable org.cloudburstmc.math.vector.Vector3isetBedPosition(org.geysermc.mcprotocollib.protocol.data.game.entity.metadata.EntityMetadata<Optional<org.cloudburstmc.math.vector.Vector3i>, ?> entityMetadata) voidsetBelowNameText(String text) voidsetCachedScore(String cachedScore) voidsetDimensionsFromPose(org.geysermc.mcprotocollib.protocol.data.game.entity.metadata.Pose pose) Set the height and width of the entity's bounding boxvoidsetDisplayName(org.geysermc.mcprotocollib.protocol.data.game.entity.metadata.EntityMetadata<Optional<net.kyori.adventure.text.Component>, ?> entityMetadata) voidsetDisplayNameVisible(org.geysermc.mcprotocollib.protocol.data.game.entity.metadata.type.BooleanEntityMetadata entityMetadata) voidsetLeftParrot(org.geysermc.mcprotocollib.protocol.data.game.entity.metadata.EntityMetadata<org.cloudburstmc.nbt.NbtMap, ?> entityMetadata) voidsetListed(boolean listed) Whether this player is currently listed.protected voidsetNametag(@Nullable String nametag, boolean fromDisplayName) protected voidsetParrot(org.cloudburstmc.nbt.NbtMap tag, boolean isLeft) Sets the parrot occupying the shoulder.voidsetPosition(org.cloudburstmc.math.vector.Vector3f position) voidsetRightParrot(org.geysermc.mcprotocollib.protocol.data.game.entity.metadata.EntityMetadata<org.cloudburstmc.nbt.NbtMap, ?> entityMetadata) voidsetScoreVisible(boolean scoreVisible) voidsetSkinVisibility(org.geysermc.mcprotocollib.protocol.data.game.entity.metadata.type.ByteEntityMetadata entityMetadata) voidsetTexturesProperty(@Nullable String texturesProperty) The textures property from the GameProfile.voidsetUsername(String username) voidMethods inherited from class org.geysermc.geyser.entity.type.LivingEntity
calculateAttribute, canUseSlot, checkInteractWithNameTag, createHealthAttribute, getBody, getBoots, getChestplate, getEquipment, getHand, getHelmet, getLeggings, getOffhand, getSaddle, hasBodyArmor, hasShield, interact, isAlive, isMaxFrozenState, isShaking, setBody, setBoots, setBoundingBoxHeight, setBoundingBoxWidth, setChestplate, setEquipment, setFreezing, setHand, setHealth, setHelmet, setLeggings, setLivingEntityFlags, setMaxFrozenState, setMaxHealth, setOffhand, setParticles, setSaddle, setScale, setSpinAttack, switchHands, updateArmor, updateAttribute, updateBedrockAttributes, updateMainHand, updateNametag, updateOffHand, updateSaddled, useArmSwingAttackMethods inherited from class org.geysermc.geyser.entity.type.Entity
addAdditionalSpawnData, getBedrockRotation, getBoundingBoxHeight, getBoundingBoxWidth, getDefinition, getDirtyMetadata, getEntityId, getFlag, getGeyserId, getHeadYaw, getMaxAir, getMotion, getNametag, getPassengers, getPitch, getPosition, getPropertyManager, getSession, getUuid, getVehicle, getYaw, hasLeashesToDrop, interactAt, isOnGround, isSilent, isValid, javaId, moveAbsolute, moveRelative, playEntityEvent, playEntityEvent, setAir, setAirSupply, setClientSideSilent, setDefinition, setEntityId, setFlag, setFlags, setFlagsDirty, setGliding, setGravity, setHeadYaw, setInvisible, setMotion, setOnGround, setPassengers, setPitch, setPose, setRiderSeatPosition, setSilent, setSneaking, setSprinting, setUuid, setValid, setVehicle, setYaw, standardDisplayName, teleport, testInteraction, updateBedrockEntityProperties, updateBedrockMetadata, updateHeadLookRotation, updateInteractiveTag, updateMountOffset, updateNametag, updatePassengerOffsets, updatePositionAndRotation, updateRotationMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.geysermc.geyser.api.entity.type.GeyserEntity
javaId
-
Field Details
-
SNEAKING_POSE_HEIGHT
public static final float SNEAKING_POSE_HEIGHT- See Also:
-
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: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
-
despawnEntity
public void despawnEntity()Description copied from class:EntityDespawns the entity- Overrides:
despawnEntityin classEntity
-
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:
moveAbsolutein classEntity
-
moveRelative
public void moveRelative(double relX, double relY, double relZ, float yaw, float pitch, float headYaw, boolean isOnGround) - Overrides:
moveRelativein classLivingEntity
-
setPosition
public void setPosition(org.cloudburstmc.math.vector.Vector3f position) - Overrides:
setPositionin classEntity
-
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:
setBedPositionin classLivingEntity
-
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
- Overrides:
getDisplayNamein classEntity
-
setDisplayName
public void setDisplayName(org.geysermc.mcprotocollib.protocol.data.game.entity.metadata.EntityMetadata<Optional<net.kyori.adventure.text.Component>, ?> entityMetadata) - Overrides:
setDisplayNamein classEntity
-
teamIdentifier
- Overrides:
teamIdentifierin classEntity
-
setNametag
- Overrides:
setNametagin classEntity
-
setDisplayNameVisible
public void setDisplayNameVisible(org.geysermc.mcprotocollib.protocol.data.game.entity.metadata.type.BooleanEntityMetadata entityMetadata) - Overrides:
setDisplayNameVisiblein classEntity
-
setBelowNameText
-
scoreVisibility
protected void scoreVisibility(boolean show) - Overrides:
scoreVisibilityin classEntity
-
setDimensionsFromPose
public void setDimensionsFromPose(org.geysermc.mcprotocollib.protocol.data.game.entity.metadata.Pose pose) Description copied from class:EntitySet the height and width of the entity's bounding box- Overrides:
setDimensionsFromPosein classLivingEntity
-
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:
positionin interfaceorg.geysermc.geyser.api.entity.type.player.GeyserPlayerEntity
-
getUsername
-
getCachedScore
-
isScoreVisible
public boolean isScoreVisible() -
getTexturesProperty
The textures property from the GameProfile. -
getBedPosition
public @Nullable org.cloudburstmc.math.vector.Vector3i getBedPosition() -
getLeftParrot
Saves the parrot currently on the player's left shoulder; otherwise null -
getRightParrot
Saves the parrot currently on the player's right shoulder; otherwise null -
isListed
public boolean isListed()Whether this player is currently listed. -
setUsername
-
setCachedScore
-
setScoreVisible
public void setScoreVisible(boolean scoreVisible) -
setTexturesProperty
The textures property from the GameProfile. -
setListed
public void setListed(boolean listed) Whether this player is currently listed.
-