1.16 20w16a - Checking custom tag on block under player

Help | Java Snapshots

Hello!

I've once again gone looking for the answer, but not finding it on my own through resources or testing.

I'm trying to test for a block under any player that has a custom name or NBT tag associated with it.

In my testing, I'm just trying to turn a stone block into a spawner, but only if it has a custom name or tag associated with it.

/execute as @a at @s if block ~ ~-0.3 ~ minecraft:stone run setblock ~ ~-1 ~ minecraft:spawner

This command works fine on normal stone , but I've like to be able to add arguments to the stone such as:

/execute as @a at @s if block ~ ~-0.3 ~ minecraft:stone[nbt={MobSpawner:1b}] run setblock ~ ~-1 ~ minecraft:spawner

My current give command:

/give @p minecraft:stone{MobSpawner:1b} 1

I'm also open to other ways of achieving similar results! Any help would be appreciated.

Posted May 12, 2020, 9:53 PM UTC

12
Loading comments…