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.
Arqade is a question and answer site for passionate videogamers on all platforms. It only takes a minute to sign up.
Sign up to join this communityI 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.
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.