2
Detecting Items with Exact names on an item
Hey guys, how do I input a command that can detect a certain item with a custom name?
Any help is great!
Any help is great!
Create an account or sign in to comment.
3
1
I figured it out nvm
1
@p[nbt={Inventory:[{id:"minecraft:brown_dye",Count:6b,tag:{display:{Name:"[{\"text\":\"Stuffy Stuffed Leather\"}]"}}},{id:"minecraft:string",Count:5b}]}]
1
You have to set some scoreboard commands.
First, something that detects if you have the item in main-hand, and sets the score to 1 if yes otherwise it sets it to 0.
And a second command to set the custom name, working the same way.
Then you place two repeating command blocks that will test if each conditions are met, then place an AND logic gate between them and place your output at the end of the gate.
I don't exactly know the commands, I only know that you can test a score with something like /testfor <player/selector>[score_<name of score>=1] but I'm not sure. Take a look at the Minecraft Wiki page about scoreboards if you want to have better info than mine...
First, something that detects if you have the item in main-hand, and sets the score to 1 if yes otherwise it sets it to 0.
And a second command to set the custom name, working the same way.
Then you place two repeating command blocks that will test if each conditions are met, then place an AND logic gate between them and place your output at the end of the gate.
I don't exactly know the commands, I only know that you can test a score with something like /testfor <player/selector>[score_<name of score>=1] but I'm not sure. Take a look at the Minecraft Wiki page about scoreboards if you want to have better info than mine...