Execute command inconsistent with "as" component
I was working on a quick creation that used a diamond pickaxe to mine blocks under you that were grass in a 3x3 area. I tested it and it didn't work and was executing under the command block, so I added the "as" component to use the entity the command found with a if component:
execute if entity @a[nbt={SelectedItem:{id:"minecraft:diamond_pickaxe"}}] as @s if block ~ ~-1 ~ grass_block run say Test
if entity @a[nbt={SelectedItem:{id:"minecraft:diamond_pickaxe"}}] checks all the players in the world that has a diamond pickaxe in their main hand, I was hoping that adding as @s would also grab the entity that it found but then the code breaks
2018-12-04, 09:41 PM
2018-12-04, 10:01 PM
2018-12-04, 09:42 PM
0
0
-