player Namespace
Functions in this namespace are related to the state of the current player.
Note
These functions are not available for biome condition scripts.
- Boolean player.isCreative()
Evaluates whether the player is in creative mode.
- Returns:
trueif the player is in creative mode,falseotherwise.- Return type:
Boolean
- Boolean player.isBurning()
Evaluates whether the player is isBurning
- Returns:
trueif the player is burning,falseotherwise.- Return type:
Boolean
- Boolean player.isSuffocating()
Evaluates whether the player is suffocating.
- Returns:
trueif the player is suffocating,falseotherwise.- Return type:
Boolean
- Boolean player.isFlying()
Evaluates whether the player is flying.
- Returns:
trueif the player is flying,falseotherwise.- Return type:
Boolean
- Boolean player.isSprinting()
Evaluates whether the player is sprinting.
- Returns:
trueif the player is sprinting,falseotherwise.- Return type:
Boolean
- Boolean player.isInLava()
Evaluates whether the player is located within lava.
- Returns:
trueif the player is in lava,falseotherwise.- Return type:
Boolean
- Boolean player.isInvisible()
Evaluates whether the player is invisible.
- Returns:
trueif the player is invisible,falseotherwise.- Return type:
Boolean
- Boolean player.isInWater()
Evaluates whether the player is in water.
- Returns:
trueif the player is in water,falseotherwise.- Return type:
Boolean
- Boolean player.isMoving()
Evaluates whether the player is moving,
falseotherwise. :rtype: Boolean
- Boolean player.isWet()
Evaluates whether the player is wet.
- Returns:
trueif the player is wet,falseotherwise.- Return type:
Boolean
- Boolean player.isRiding()
Evaluates whether the player is riding an entity such as a horse or minecart.
- Returns:
trueif the player is riding,falseotherwise.- Return type:
Boolean
- Boolean player.isOnGround()
Evaluates whether the player is on the ground.
- Returns:
trueif the player is on the ground,falseotherwise.- Return type:
Boolean
- Boolean player.canRainOn()
Evaluates whether the player is in the open where rain can fall on them.
- Returns:
trueif the player can be rained on,falseotherwise.- Return type:
Boolean
- Boolean player.canSeeSky()
Evaluates whether the player is able to see the sky when looking up.
- Returns:
trueif the player can see the sky,falseotherwise.- Return type:
Boolean
- Float player.getHealth()
Gets the current health of the player.
- Returns:
Player’s current health
- Return type:
Float
- Float player.getMaxHealth()
Gets the players maximum possible health value.
- Returns:
Player’s maximum health
- Return type:
Float
- Float player.getFoodLevel()
Gets the players current food level.
- Returns:
Player’s current food level
- Return type:
Float
- Float player.getFoodSaturationLevel()
Gets the player’s current food saturation level.
- Returns:
Player’s current food saturation level.
- Return type:
Float
- Double player.getX()
Gets the X value of the player’s current block position.
- Returns:
X value of the block position of the player
- Return type:
Double
- Double player.getY()
Gets the Y value of the player’s current block position.
- Returns:
Y value of the block position of the player
- Return type:
Double
- Double player.getZ()
Gets the Z value of the player’s current block position.
- Returns:
Z value of the block position of the player
- Return type:
Double
- Boolean player.hasEffect(String effect)
Evaluates whether the player has the specified effect. The effect is expressed as a resource location ID.
- Arguments:
effect (
String()) – The effect to check for
- Returns:
Returns
trueif the player has the given effect,falseotherwise.- Return type:
Boolean