1

So I'm trying to make a thing where you walk up to it and a gate opens if you have a paper that is named on you but since the 1.13 update I don't know how to do that

1 Answer 1

1

The things that have changed since 1.12 are the JSON formatting of custom names, the position of the NBT data of the command and the /execute command itself.

Let's say I would like to test if I have a paper on me that is named "Card". Here's what the command would look like:

/execute if entity @p[nbt={Inventory:[{id:"minecraft:paper",tag:{display:{Name:"{\"text\":\"Card\"}"}}}]}]

First of all, I use /execute if instead of /testfor. Next, I put the NBT into a different position, @p[nbt={NBT}] instead of just @p {NBT}. Finally, the JSON formatting. Instead of {Name:"<Name>"} I used {Name:"{\"text\":\"<Name>\"}"}.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .