Skip to content
Omar Mohamed edited this page Mar 11, 2026 · 3 revisions

Player

Represents the local player. Provides access to position, health, held items, movement state, world interaction, and sound playback.


Functions

World & Blocks

getSteppingBlock()

Returns the block the player is currently standing on.

make block player.getSteppingBlock()
say block.getName()

getNearbyBlocks(blockRadius)

Returns all non-air blocks within a cubic radius around the player.

  • Parameters:
    • blockRadiusInteger — Radius in blocks
  • Returns: List<Block>
make blocks player.getNearbyBlocks(3)
say size(blocks)

getTargetBlock()

Returns the block the player is currently looking at, or null if not targeting a block.

make target player.getTargetBlock()
check target != null do
    say target.getName()
end

getWorld()

Returns the current world the player is in.

make world player.getWorld()
say world.getDimension()

Position & Movement

getPosition()

Returns the player's current block position.

make pos player.getPosition()
say pos.toString()

getVelocityX()

Returns the player's velocity along their local forward/backward axis (relative to yaw).

  • Returns: Double

getVelocityY()

Returns the player's vertical velocity. Returns 0.0 during standard gravity fall.

  • Returns: Double

getVelocityZ()

Returns the player's velocity along their local left/right axis (relative to yaw).

  • Returns: Double
debugText("vX: " + player.getVelocityX())
debugText("vY: " + player.getVelocityY())
debugText("vZ: " + player.getVelocityZ())

getCameraPitchVelocity()

Returns the rate of change of the camera's pitch (vertical look speed).

  • Returns: Float

getCameraYawVelocity()

Returns the rate of change of the camera's yaw (horizontal look speed).

  • Returns: Float
make item player.getMainHandItem()
item.rotateX(player.getCameraPitchVelocity() * 2)
item.rotateY(player.getCameraYawVelocity() * 2)

Stats

getHealth()

Returns the player's current health.

  • Returns: Double

getFoodLevel()

Returns the player's current food/hunger level (0–20).

  • Returns: Double

getSaturationLevel()

Returns the player's current saturation level.

  • Returns: Double

getNauseaIntensity()

Returns the current nausea effect intensity.

  • Returns: Float

getExperienceLevel()

Returns the player's current experience level.

  • Returns: Integer

getExperienceProgress()

Returns the player's progress toward the next experience level (0.0–1.0).

  • Returns: Double

getMoodPercentage()

Returns the player's current mood percentage (used for cave ambience sounds).

  • Returns: Float

getPermissionLevel()

Returns the player's current operator permission level (0–4).

  • Returns: Integer

getMountJumpStrength()

Returns the jump strength of the player's current mount.

  • Returns: Float

getGamemode()

Returns the player's current gamemode as a string.

  • Returns: String — e.g. "survival", "creative"
debugText("HP: " + player.getHealth())
debugText("Food: " + player.getFoodLevel())
debugText("XP Level: " + player.getExperienceLevel())
debugText("Gamemode: " + player.getGamemode())

Held Items

getActiveItem()

Returns the item currently being used (e.g. while eating or drawing a bow).

getMainHandItem()

Returns the item in the player's main hand.

getOffHandItem()

Returns the item in the player's off hand.

isMainHand(item)

Returns whether the given ItemModel is in the main hand.

  • Parameters:
  • Returns: Boolean

isOffHand(item)

Returns whether the given ItemModel is in the off hand.

  • Parameters:
  • Returns: Boolean

isHoldingItem(itemId)

Returns whether the player is holding an item with the given ID in either hand.

  • Parameters:
    • itemIdString
  • Returns: Boolean
check player.isHoldingItem("minecraft:diamond_sword") do
    make item player.getMainHandItem()
    item.setColor(100, 180, 255)
end

Movement State

isSwimming()

Returns whether the player is swimming.

  • Returns: Boolean

isSprinting()

Returns whether the player is sprinting.

  • Returns: Boolean

isSneaking()

Returns whether the player is sneaking.

  • Returns: Boolean

isInSneakingPose()

Returns whether the player is in a sneaking pose (visual).

  • Returns: Boolean

isCrawling()

Returns whether the player is crawling.

  • Returns: Boolean

isClimbing()

Returns whether the player is climbing (e.g. ladder or vine).

  • Returns: Boolean

isDescending()

Returns whether the player is descending (e.g. on a ladder).

  • Returns: Boolean

isHoldingOntoLadder()

Returns whether the player is holding onto a ladder.

  • Returns: Boolean

isOnGround()

Returns whether the player is on the ground.

  • Returns: Boolean

isOnRail()

Returns whether the player is on a rail.

  • Returns: Boolean

isJumping()

Returns whether the player is currently jumping.

  • Returns: Boolean

isRiding()

Returns whether the player is riding an entity.

  • Returns: Boolean

isRidingJumpable()

Returns whether the player is riding a mount that can jump.

  • Returns: Boolean

isFlyingVehicle()

Returns whether the player is in a flying vehicle.

  • Returns: Boolean

shouldSlowDown()

Returns whether the player's movement should be slowed (e.g. in a cobweb or powder snow).

  • Returns: Boolean

isHorizontalCollision()

Returns whether the player is colliding with a block horizontally.

  • Returns: Boolean

isAutoJumpEnabled()

Returns whether auto-jump is enabled.

  • Returns: Boolean
make item player.getMainHandItem()
check player.isSprinting() do
    item.translate(0, 0, -0.05)
end
check player.isSneaking() do
    item.translateY(-0.1)
end
check player.isJumping() do
    item.translateY(0.1)
end

Player Status

isInLava()

Returns whether the player is in lava.

  • Returns: Boolean

isInFluid()

Returns whether the player is in any fluid.

  • Returns: Boolean

isTouchingWater()

Returns whether the player is touching water.

  • Returns: Boolean

isSubmergedInWater()

Returns whether the player is fully submerged in water.

  • Returns: Boolean

isOnFire()

Returns whether the player is on fire.

  • Returns: Boolean

isFireImmune()

Returns whether the player is immune to fire damage.

  • Returns: Boolean

isFrozen()

Returns whether the player is frozen (in powder snow).

  • Returns: Boolean

isInsideWall()

Returns whether the player is clipping inside a block.

  • Returns: Boolean

isAtCloudHeight()

Returns whether the player is at cloud height.

  • Returns: Boolean

isBlocking()

Returns whether the player is blocking with a shield.

  • Returns: Boolean

isUsingItem()

Returns whether the player is currently using an item.

  • Returns: Boolean

isUsingRiptide()

Returns whether the player is currently using a riptide trident.

  • Returns: Boolean

isUsingSpyglass()

Returns whether the player is currently using a spyglass.

  • Returns: Boolean

isGlowing()

Returns whether the player has the glowing effect (server-side).

  • Returns: Boolean

isGlowingLocal()

Returns whether the player is glowing locally (client-side).

  • Returns: Boolean

isPushable()

Returns whether the player can be pushed by other entities.

  • Returns: Boolean

isPushedByFluids()

Returns whether the player is pushed by fluid currents.

  • Returns: Boolean

isInvulnerable()

Returns whether the player is currently invulnerable.

  • Returns: Boolean

isCamera()

Returns whether the player is the current camera entity.

  • Returns: Boolean

isMainPlayer()

Returns whether this is the main/local player.

  • Returns: Boolean

showsDeathScreen()

Returns whether the player would show the death screen upon dying.

  • Returns: Boolean

isLimitedCraftingEnabled()

Returns whether limited crafting is enabled for this player.

  • Returns: Boolean
make item player.getMainHandItem()
check player.isOnFire() do
    item.setColor(255, 80, 0)
end
check player.isFrozen() do
    item.setColor(150, 220, 255)
end
check player.isSubmergedInWater() do
    item.setOpacity(0.7)
end

Sound

playSound(soundId, volume, pitch)

Plays a sound at the player's position.

  • Parameters:
    • soundIdString — Namespaced sound ID (e.g. "minecraft:entity.experience_orb.pickup")
    • volumeDouble
    • pitchDouble

playSound(sound)

Plays a Sound object at the player's position.

  • Parameters:

playSoundWorld(position, soundId, volume, pitch)

Plays a sound at a specific world position.

  • Parameters:
    • positionPosition
    • soundIdString
    • volumeDouble
    • pitchDouble

playSoundWorld(position, sound)

Plays a Sound object at a specific world position.

~ Play a simple sound on the player
player.playSound("minecraft:entity.experience_orb.pickup", 1.0, 1.0)

~ Play using a Sound object
make pos new Position(0, 64, 0)
make snd new Sound("minecraft:block.note_block.harp", 1.0, 1.2, pos)
player.playSound(snd)

~ Play at a world position
player.playSoundWorld(player.getPosition(), "minecraft:ambient.cave", 0.5, 1.0)

📖 InteractiveStuff Docs


🧱 Types


⚙️ Scripting

📃 Built-in Library

Clone this wiki locally