#Execute as player standing somewhere

1 messages · Page 1 of 1 (latest)

cyan dragon
#

How to only execute if a player is holding an item and at a certain block?

jade pulsar
#

/execute as @a[hasitem={item=<item>, location=slot.weapon.mainhand}] at @s if block <block> ~~-0.03~ run ...

cyan dragon
#

What about a certain cord instead

#

@jade pulsar

jade pulsar
#

/execute as @a[hasitem={item=<item>, location=slot.weapon.mainhand},x=<>,y=<>,z=<>,dy=<>] at @s if block <block> ~~-0.03~ run ...

cyan dragon
cyan dragon
jade pulsar
#

dy=2

#

/execute as @a[hasitem={item=purple_stained_glass_pane,location=slot.weapon.mainhand},x=-12,y=54,z=29,dy=2] at @s run w @s @s

glacial frigate
#

/execute positioned <cords> as @p[has_item={item=<item name>,location=slot.weapon.mainhand}] at @s run <command>

jade pulsar
#

/execute positioned <block location> as @p[has_item={item=<item name>,location=slot.weapon.mainhand},r=1] at @s run <command>

#

What you want to trigger when the condition is true?

hoary apex
#
/execute at @a[x=<>,y=<>,z=<>,hasitem={item=<>,location=slot.weapon.mainhand}] as @p run /<>