Skip to main content

Player API

This page is generated from a recorded Java binding inventory. Supported means an official script uses the member; it does not mean the member has passed focused and live acceptance testing.

MemberStabilityVerificationAI-runnableOfficial usePurpose
attackExperimentalboundNoNoAttack
can_reach_blockExperimentalboundNoNoCheck if block is within mining range Returns true if block is within 4.5 blocks and has line of sight
distance_toSupportedboundNoYesGet 3D distance to position
drop_itemExperimentalboundNoNodrop current held item
equipSupportedboundNoYesEquip
find_hotbar_slotExperimentalboundNoNofind slot with item matching pattern (-1 if not found)
get_air_control_factorExperimentalboundNoNoGet air control effectiveness (0.0-1.0). Returns multiplier for strafe effectiveness when airborne With high Jump Boost, this can be as low as 0.05 (5%)
get_effectSupportedboundNoYesGet info about an active potion effect Returns table {active, level, amplifier, duration, ambient} or nil if not active
get_hotbar_itemsExperimentalboundNoNoget table of all hotbar item names
get_jump_boost_levelExperimentalboundNoNoGet jump boost level (0 = none, 1-5 = Jump Boost I-V)
get_max_jump_heightExperimentalboundNoNoGet max jump height in blocks Takes into account Jump Boost effect
get_nearestSupportedboundNoYesreturns name of nearest player
healthExperimentalboundNoNoHealth
health_percentSupportedboundNoYesHealth Percent
held_itemExperimentalboundNoNoHeld Item
held_slotExperimentalboundNoNoHeld Slot
horizontal_distanceSupportedboundNoYesreturns horizontal distance to location
hotbar_containsExperimentalboundNoNocheck if item matching pattern is in hotbar
hungerExperimentalboundNoNoHunger
interact_blockSupportedboundNoYesright-click a specific block Looks at block center first, then sends use-item-on interaction
interact_entityExperimentalboundNoNoInteract Entity
is_flyingExperimentalboundNoNoIs Flying
is_on_groundExperimentalboundNoNoIs On Ground
is_rotation_lockedExperimentalboundNoNoIs Rotation Locked
is_sneakingExperimentalboundNoNoIs Sneaking
is_sprintingExperimentalboundNoNoIs Sprinting
jumpSupportedboundNoYesJump
look_atSupportedboundNoYesLook At
max_healthExperimentalboundNoNoMax Health
nameSupportedboundNoYesName
pitchSupportedboundNoYesPitch
positionSupportedboundNoYesPosition
raycastExperimentalboundNoNoRaycast
sneakSupportedboundNoYesSneak
sprintExperimentalboundNoNoSprint
swing_handExperimentalboundNoNoSwing Hand
use_itemSupportedboundNoYesUse Item
xSupportedboundNoYesX
ySupportedboundNoYesY
yawSupportedboundNoYesYaw
zSupportedboundNoYesZ