# PlayerData
Represents a player.
A PlayerData usually has all of the properties of LivingEntityData, and:
foodStats
: FoodStatsData: Equal to the player'sfoodStats
.cameraYaw
: Number: Equal to the player'scameraYaw
.chasingPosX
: Number: Equal to the player'schasingPosX
.chasingPosY
: Number: Equal to the player'schasingPosY
.chasingPosZ
: Number: Equal to the player'schasingPosZ
.experience
: Number: The player's experience number.experienceLevel
: Integer: The player's experience level.experienceTotal
: Integer: The player's experience total.fishEntity
: FishHookData: The player's fishing bobber / hook. (If existing)flyToggleTimer
: Integer: Equal to the player'sflyToggleTimer
.hasReducedDebug
: Boolean: Equal to the player'shasReducedDebug
.itemInUseCount
: Integer: The count of the item that the player is currenly using. (Read-only)itemInUse
: ItemStackData: The itemstack the player is using. (If existing)lastXPSound
: Integer: Equal to the player'slastXPSound
.sleepTimer
: Integer: Equal to the player'ssleepTimer
.sleeping
: Boolean: Whether or not the player is sleeping.spawnForced
: Boolean: Equal to the player'sspawnForced
.speedInAir
: Number: Equal to the player'sspeedInAir
.speedOnGround
: Number: Equal to the player'sspeedOnGround
.xpCooldown
: Integer: Equal to the player'sxpCooldown
.xpSeed
: Integer: Equal to the player'sxpSeed
.inventoryContainer
: ContainerData: Equal to the player'sinventoryContainer
.openContainer
: ContainerData: Equal to the player'sopenContainer
.inventory
: InventoryPlayerData: Equals to the player'sinventory
.capabilities
: PlayerCapabilities: Equals to the player'scapabilities
.
It has the following methods:
getItemInUse() : ItemStackData
getItemInUseCount() : Integer
isUsingItem() : Boolean
getItemInUseDuration() : Integer
stopUsingItem() : void
clearItemInUse() : void
isBlocking() : Boolean
getMaxInPortalTime() : Integer
getSwimSound() : String
getSplashSound() : String
getPortalCooldown() : Integer
playSound({s: String, f: Number, f1: Number}) : void
updateItemUse({itemStackIn: ItemStackData, parInt1: Integer}) : void
onItemUseFinish() : void
handleStatusUpdate({b0: Byte}) : void
isMovementBlocked() : Boolean
closeScreen() : void
updateRidden() : void
preparePlayerToSpawn() : void
updateEntityActionState() : void
onLivingUpdate() : void
collideWithPlayer({parEntity: EntityData}) : void
getScore() : Integer
addScore({parInt1: Integer}) : void
getHurtSound() : String
getDeathSound() : String
addToPlayerScore({entity: EntityData, i: Integer}) : void
dropOneItem({flag: Boolean}) : ItemEntityData
dropPlayerItemWithRandomChoice({itemStackIn: ItemStackData}) : ItemEntityData
dropItem({droppedItem: ItemStackData, dropAround: Boolean, traceItem: Boolean}) : ItemEntityData
joinEntityItemWithWorld({entityitem: ItemEntityData}) : void
getToolDigEfficiency({parBlock: BlockData}) : Number
canHarvestBlock({blockToHarvest: BlockData}) : Boolean
canAttackPlayer({entityplayer: PlayerData}) : Boolean
damageArmor({f: Number}) : void
getTotalArmorValue() : Integer
getArmorVisibility() : Number
interactWith({parEntity: EntityData}) : Boolean
getCurrentEquippedItem() : ItemStackData
destroyCurrentEquippedItem() : void
getYOffset() : Number
attackTargetEntityWithCurrentItem({entity: EntityData}) : void
respawnPlayer() : void
isEntityInsideOpaqueBlock() : Boolean
isUser() : Boolean
trySleep({blockpos: BlockPos}) : String
wakeUpPlayer({flag: Boolean, flag1: Boolean, flag2: Boolean}) : void
isInBed() : Boolean
getBedOrientationInDegrees() : Number
isPlayerSleeping() : Boolean
isPlayerFullyAsleep() : Boolean
getSleepTimer() : Integer
getBedLocation() : BlockPos
isSpawnForced() : Boolean
setSpawnPoint({pos: BlockPos, forced: Boolean}) : void
moveEntityWithHeading({f: Number, f1: Number}) : void
getAIMoveSpeed() : Number
addMovementStat({parDouble1: Number, parDouble2: Number, parDouble3: Number}) : void
addMountedMovementStat({parDouble1: Number, parDouble2: Number, parDouble3: Number}) : void
fall({f: Number, f1: Number}) : void
resetHeight() : void
getFallSoundString({i: Integer}) : String
setInWeb() : void
getCurrentArmor({i: Integer}) : ItemStackData
addExperience({amount: Integer}) : void
getXPSeed() : Integer
removeExperienceLevel({i: Integer}) : void
addExperienceLevel({i: Integer}) : void
xpBarCap() : Integer
addExhaustion({parFloat1: Number}) : void
getFoodStats() : FoodStatsData
canEat({ignoreHunger: Boolean}) : Boolean
shouldHeal() : Boolean
setItemInUse({itemstack: ItemStackData, i: Integer}) : void
isAllowEdit() : Boolean
canPlayerEdit({parBlockPos: BlockPos, parEnumFacing: String, parItemStack: ItemStackData}) : Boolean
parEnumFacing
can be one ofUP
,DOWN
,NORTH
,SOUTH
,EAST
orWEST
isPlayer() : Boolean
getAlwaysRenderNameTagForRender() : Boolean
clonePlayer({entityplayer: PlayerData, flag: Boolean}) : void
canTriggerWalking() : Boolean
sendPlayerAbilities() : void
getName() : String
getEquipmentInSlot({i: Integer}) : ItemStackData
getHeldItem() : ItemStackData
setCurrentItemOrArmor({i: Integer, itemstack: ItemStackData}) : void
isInvisibleToPlayer({entityplayer: PlayerData}) : Boolean
getInventory() : ItemStackData[]
isPushedByWater() : Boolean
getEyeHeight() : Number
getOfflineUUID({username: String}) : String
replaceItemInInventory({i: Integer, itemstack: ItemStack}) : Boolean
hasReducedDebug() : Boolean
setReducedDebug({reducedDebug: Boolean}) : void