-
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()
endReturns 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 X coordinate of the player's eye position.
-
Returns:
Double
Returns the Y coordinate of the player's eye position.
-
Returns:
Double
Returns the Z coordinate of the player's eye position.
-
Returns:
Double
debugText("Eye: " + player.getEyePosX() + ", " + player.getEyePosY() + ", " + player.getEyePosZ())Returns the player's current head yaw (horizontal rotation in degrees).
-
Returns:
Double
debugText("Head yaw: " + player.getHeadYaw())Returns the yaw direction of the most recent damage tilt effect.
-
Returns:
Double
Returns the player's step height (how tall a block they can step up without jumping).
-
Returns:
Double
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 player's current total armor value.
-
Returns:
Integer
debugText("Armor: " + player.getArmor())Returns how many ticks the player has been using their current item.
-
Returns:
Integer
Returns how many ticks remain before the player finishes using their current item.
-
Returns:
Integer
debugText("Use time: " + player.getItemUseTime())
debugText("Use time left: " + player.getItemUseTimeLeft())Returns the player's current luck attribute value.
-
Returns:
Float
Returns the player's current absorption (bonus health) amount.
-
Returns:
Float
Returns the player's maximum absorption amount.
-
Returns:
Float
debugText("Absorption: " + player.getAbsorptionAmount() + " / " + player.getMaxAbsorption())Returns the number of arrows currently stuck in the player.
-
Returns:
Integer
Returns the number of bee stingers currently stuck in the player.
-
Returns:
Integer
debugText("Arrows: " + player.getStuckArrowCount())
debugText("Stingers: " + player.getStingerCount())Returns the player's scale factor (used for size-affecting effects).
-
Returns:
Float
Returns the player's current scale.
-
Returns:
Float
debugText("Scale: " + player.getScale())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 the item currently being used to block (e.g. a shield being held up).
-
Returns:
ItemModel
make blocking player.getBlockingItem()
check blocking != null do
debugText("Blocking with: " + blocking.getName())
endReturns the item considered the player's active weapon.
-
Returns:
ItemModel
debugText("Weapon: " + player.getWeaponItem().getName())Returns the item that would be picked when using pick-block (middle-click).
-
Returns:
ItemModel
debugText("Pick block item: " + player.getPickBlockItem().getName())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)
endReturns 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)
endReturns whether the player is currently in first-person perspective.
-
Returns:
Boolean
check player.isFirstPerson() do
make item player.getMainHandItem()
item.translateY(-0.05)
endReturns 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
Returns whether the player is dead.
-
Returns:
Boolean
Returns whether the player is in baby form.
-
Returns:
Boolean
Returns whether the player can breathe underwater (e.g. via a helmet enchantment or effect).
-
Returns:
Boolean
Returns whether the player has just landed in a fluid.
-
Returns:
Boolean
Returns whether the player is currently able to take damage.
-
Returns:
Boolean
Returns whether the player entity is considered an active part of the game world.
-
Returns:
Boolean
Returns whether the player should swim when in fluids.
-
Returns:
Boolean
Returns whether the player has no drag applied (no velocity dampening from fluids or air).
-
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)
endPlays 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.