I don't know how to put those two conditions together into one command. I tried

/scoreboard players add @a{Inventory:[{id:"minecraft:iron_ingot"}]} [x=-506,y=56,z=-1176,r=1] Score 1

but it doesn't work, and I have trouble with brackets.

  • @MrLemon I removed the comment and added it as an answer.
    – GiantTree
    Jun 29 '15 at 9:02

Your whole command is invalid.
The correct format would be

/scoreboard players add <player> <objective> <count> [dataTag]

so your command would then become:

/scoreboard players add @a[x=-506,y=56,z=-1176,r=1] Score 1 {Inventory:[{id:"minecraft:iron_ingot"}]}

Always remember: NBT data tags always come last in a command.

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.