I'm trying to make an adventure map in Minecraft Java with blanket permission to place anything on certain block types, and break certain others, by appropriate tool. I'm currently trying to clock command blocks to run a /tag command on everything in a hotbar, but i can't figure out the syntax, and the wiki page for /tag has all of 23 lines of text, assuming a user can figure out the name field with no examples or reference links. My test command block, reading, as of now, "tag @e[nbt={Item:{slot:0}}] add {CanDestroy:["stone"]}", is flagging "{CanDestroy:["stone"]}" as red(error), because "Expected whitespace to end one argument, but found trailing data at position32: ...:0}" How do i format this for the tag command? Or am i going about this all wrong? I want to allow players to place/break with crafted items, so i can't very well just regulate inventoty with /give, which seems to be the standard approach for these NBT tags.
PS: The name field, for what it's worth, was angle bracketed, but that wouldn't display here.
CanDestroy
. I do not think what you want is possible, without requiring the player to drop the item. But who knows, maybe I've overlooked something.