I'm working on a map, and at one part of it, you have to have a Lime Green Carpet in your inventory (I know the data for that is 14), and then it takes it and removes some blocks using /fill. I was using this:

/testfor @a {Inventory:[{id:<minecraft:carpet>,Damage:<14>s}]}

I got that off another question, but it has to be named: $5

Anyone know what I'm doing wrong? I'm no command expert, so I need some help.

  • Things like solved or answered don't belong in questions; we strive to ensure that questions can help more than just the asker, and who knows? Someone might come up with a better answer.
    – Frank
    Aug 15 '16 at 19:22

First do into the chat

/scoreboard objectives add Money dummy

Then in a repeating command block have

/scoreboard players set @a Money 0

Then in a chain command block do this command

/scoreboard players set @a Money 1 {SelectedItem:{tag:{display:{Name:"$5"}}}}

And in another chain command block

/execute @a[score_Money_min=1] ~ ~ ~ YOURCOMMANDHERE

And that is how you do it.

  • Thank you for the help! I decided to stop work on that map but I needed that for my new map. I'll try that, thanks! Aug 15 '16 at 19:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.