-
Notifications
You must be signed in to change notification settings - Fork 0
Player
Represents the local player. Provides access to position, health, held items, movement state, world interaction, and sound playback.
Returns the block the player is currently standing on.
-
Returns:
Block
make block player.getSteppingBlock()
say block.getName()
Returns all non-air blocks within a cubic radius around the player.
-
Parameters:
-
blockRadius—Integer— Radius in blocks
-
-
Returns:
List<Block>
make blocks player.getNearbyBlocks(3)
say size(blocks)
Returns the block the player is currently looking at, or null if not targeting a block.
-
Returns:
Block
make target player.getTargetBlock()
check target != null do
say target.getName()
end
Returns the current world the player is in.
-
Returns:
World
make world player.getWorld()
say world.getDimension()
Returns the player's current block position.
-
Returns:
Position
make pos player.getPosition()
say pos.toString()
Returns the player's velocity along their local forward/backward axis (relative to yaw).
-
Returns:
Double
Returns the player's vertical velocity. Returns 0.0 during standard gravity fall.
-
Returns:
Double
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())
Returns the rate of change of the camera's pitch (vertical look speed).
-
Returns:
Float
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)
Returns the player's current health.
-
Returns:
Double
Returns the player's current food/hunger level (0–20).
-
Returns:
Double
Returns the player's current saturation level.
-
Returns:
Double
Returns the current nausea effect intensity.
-
Returns:
Float
Returns the player's current experience level.
-
Returns:
Integer
Returns the player's progress toward the next experience level (0.0–1.0).
-
Returns:
Double
Returns the player's current mood percentage (used for cave ambience sounds).
-
Returns:
Float
Returns the player's current operator permission level (0–4).
-
Returns:
Integer
Returns the jump strength of the player's current mount.
-
Returns:
Float
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())
Returns the item currently being used (e.g. while eating or drawing a bow).
-
Returns:
ItemModel
Returns the item in the player's main hand.
-
Returns:
ItemModel
Returns the item in the player's off hand.
-
Returns:
ItemModel
Returns whether the given ItemModel is in the main hand.
-
Parameters:
-
item—ItemModel
-
-
Returns:
Boolean
Returns whether the given ItemModel is in the off hand.
-
Parameters:
-
item—ItemModel
-
-
Returns:
Boolean
Returns whether the player is holding an item with the given ID in either hand.
-
Parameters:
-
itemId—String
-
-
Returns:
Boolean
check player.isHoldingItem("minecraft:diamond_sword") do
make item player.getMainHandItem()
item.setColor(100, 180, 255)
end
Returns whether the player is swimming.
-
Returns:
Boolean
Returns whether the player is sprinting.
-
Returns:
Boolean
Returns whether the player is sneaking.
-
Returns:
Boolean
Returns whether the player is in a sneaking pose (visual).
-
Returns:
Boolean
Returns whether the player is crawling.
-
Returns:
Boolean
Returns whether the player is climbing (e.g. ladder or vine).
-
Returns:
Boolean
Returns whether the player is descending (e.g. on a ladder).
-
Returns:
Boolean
Returns whether the player is holding onto a ladder.
-
Returns:
Boolean
Returns whether the player is on the ground.
-
Returns:
Boolean
Returns whether the player is on a rail.
-
Returns:
Boolean
Returns whether the player is currently jumping.
-
Returns:
Boolean
Returns whether the player is riding an entity.
-
Returns:
Boolean
Returns whether the player is riding a mount that can jump.
-
Returns:
Boolean
Returns whether the player is in a flying vehicle.
-
Returns:
Boolean
Returns whether the player's movement should be slowed (e.g. in a cobweb or powder snow).
-
Returns:
Boolean
Returns whether the player is colliding with a block horizontally.
-
Returns:
Boolean
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
Returns whether the player is in lava.
-
Returns:
Boolean
Returns whether the player is in any fluid.
-
Returns:
Boolean
Returns whether the player is touching water.
-
Returns:
Boolean
Returns whether the player is fully submerged in water.
-
Returns:
Boolean
Returns whether the player is on fire.
-
Returns:
Boolean
Returns whether the player is immune to fire damage.
-
Returns:
Boolean
Returns whether the player is frozen (in powder snow).
-
Returns:
Boolean
Returns whether the player is clipping inside a block.
-
Returns:
Boolean
Returns whether the player is at cloud height.
-
Returns:
Boolean
Returns whether the player is blocking with a shield.
-
Returns:
Boolean
Returns whether the player is currently using an item.
-
Returns:
Boolean
Returns whether the player is currently using a riptide trident.
-
Returns:
Boolean
Returns whether the player is currently using a spyglass.
-
Returns:
Boolean
Returns whether the player has the glowing effect (server-side).
-
Returns:
Boolean
Returns whether the player is glowing locally (client-side).
-
Returns:
Boolean
Returns whether the player can be pushed by other entities.
-
Returns:
Boolean
Returns whether the player is pushed by fluid currents.
-
Returns:
Boolean
Returns whether the player is currently invulnerable.
-
Returns:
Boolean
Returns whether the player is the current camera entity.
-
Returns:
Boolean
Returns whether this is the main/local player.
-
Returns:
Boolean
Returns whether the player would show the death screen upon dying.
-
Returns:
Boolean
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
Plays a sound at the player's position.
-
Parameters:
-
soundId—String— Namespaced sound ID (e.g."minecraft:entity.experience_orb.pickup") -
volume—Double -
pitch—Double
-
Plays a Sound object at the player's position.
-
Parameters:
-
sound—Sound
-
Plays a sound at a specific world position.
-
Parameters:
-
position—Position -
soundId—String -
volume—Double -
pitch—Double
-
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)
GET IN TOUCH - omar@merakistudios.dev
© 2026 Omar Mohamed. All Rights Reserved.