I have a question. I wanted to test via Command, if there's a paper in my inventory. This is what I did with this command:
/ execute as @p if entity @s [nbt = {Inventory: [{id: "minecraft: paper"}]}]
Now I want to test if there's a paper called "test" in inventory. How can you include the name in Command above? (1.14.1)
Generally one can query the data from all possible items by picking them up and executing the following command:
/ data get entity @s SelectedItem
It turns out that paper items named "test" have this tag:
{id: "minecraft: paper", tag: {display: {name: '{"text": "test"}'}}}
If you use this tag in your command, the final test results:
/ execute as @p if entity @s [nbt = {Inventory: [{id: "minecraft: paper", tag: {display: {name: '{"text": "test"}'}}}]}]