0

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.

1
  • 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
    Commented Aug 15, 2016 at 19:22

1 Answer 1

0

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.

1
  • 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! Commented Aug 15, 2016 at 19:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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