Skip to main content

🔗 Chain Arguments

Introduction​

Chain Arguments represent a dot-notation syntax (connected by .) used to access object-related parameters in a hierarchical manner.

For example, in an interaction event where we can access the player instance, we can retrieve additional parameters through this object.

By chaining property accessors like:

  • player.world → Gets the player's current world
  • world.name → Gets the name of that world

We can combine them into a parameter tag format like <arg:player.world.name>. This tag dynamically returns the name of the world the player is currently in.

Both <arg:path> and <viewer_arg:path> support chain arguments. The first segment is a context key, so the available roots depend on where the text is evaluated. For example, an item may be exposed as item, item_in_hand, furniture_item, player.main_hand_item, player.off_hand_item, or entity.item.

If a value may be unavailable, provide a default with <arg:path:default>, such as <arg:entity.item.id:none>. A missing value without a default causes an error.

Objects​

player​

parametertypedescription
xdoublethe x coordinate of the player
ydoublethe y coordinate of the player
zdoublethe z coordinate of the player
pitchfloatthe pitch of the player
yawfloatthe yaw of the player
position#positionthe position of the player
block_xintthe x coordinate of the player
block_yintthe y coordinate of the player
block_zintthe z coordinate of the player
foodintthe food level of the player
saturationfloatthe saturation of the player
namestringthe name of the player
uuiduuidthe uuid of the player
world#worldthe world where the player is in
is_sneakingbooleancheck the sneak state
is_swimmingbooleancheck the swimming state
is_climbingbooleancheck the climbing state
is_glidingbooleancheck the gliding state
is_flyingbooleancheck the fly state
gamemodestringthe gamemode of the player
game_editionstringthe game edition of the player
main_hand_item#itemthe item in main hand
off_hand_item#itemthe item in off hand

block​

parametertypedescription
xintthe x coordinate of the block
yintthe y coordinate of the block
zintthe z coordinate of the block
block_xintthe x coordinate of the block
block_yintthe y coordinate of the block
block_zintthe z coordinate of the block
custom_blockblock definitionthe custom block definition; absent for a vanilla block
custom_block_stateblock statethe complete custom block state; absent for a vanilla block
world#worldthe world where the block is in
position#positionthe position of the block

world​

parametertypedescription
namestringthe name of the world
uuiduuidthe uuid of the world
timelongthe time of the world

entity​

parametertypedescription
xdoublethe x coordinate of the entity
ydoublethe y coordinate of the entity
zdoublethe z coordinate of the entity
pitchfloatthe entity's yRot value (yaw)
yawfloatthe entity's xRot value (pitch)
block_xintthe x coordinate of the entity
block_yintthe y coordinate of the entity
block_zintthe z coordinate of the entity
namestringthe name of the entity
uuiduuidthe uuid of the entity
world#worldthe world where the entity is in
position#positionthe position of the entity
fire_ticksintthe entity's remaining fire ticks
speeddoublethe magnitude of the entity's current velocity in blocks per tick
healthdoublethe health of a living entity; 0 for other entities
max_healthdoublethe maximum health of a living entity; 0 for other entities
item#itemthe item of a dropped-item entity; absent otherwise

position​

parametertypedescription
world#worldthe world
coordinate#positionthe same coordinate-bearing position object
xdoublethe x coordinate
ydoublethe y coordinate
zdoublethe z coordinate
yawfloatthe position's xRot value (pitch)
pitchfloatthe position's yRot value (yaw)
block_xintthe floored x coordinate
block_yintthe floored y coordinate
block_zintthe floored z coordinate
biomestringthe namespaced id of the biome
block#blockthe block at the floored coordinates

item​

parametertypedescription
idstringthe id of the item
custom_model_dataintthe custom model data of the item
is_custombooleanchecks if the item is custom
countintthe count of the item
is_block_itembooleanchecks if the item is vanilla block item
random.<id>doublethe item's rolled random value (see random_values)

random​

parametertypedescription
<id>doublea named random value in the current context; missing ids roll and cache a value from 0 to 1

furniture​

parametertypedescription
idstringthe id of the furniture
uuiduuidthe uuid of the furniture
variantstringthe variant of the furniture
xdoublethe x coordinate of the furniture
ydoublethe y coordinate of the furniture
zdoublethe z coordinate of the furniture
yawfloatthe yaw of the furniture
pitchfloatthe pitch of the furniture
position#positionthe position of the furniture