How can I increase a scoreboard objective if player is at specific coords and has a specific item in his inventory?

How can I increase a scoreboard objective if player is at specific coords and has a specific item in his inventory? - Hand Holding Fishing Baits

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.






Pictures about "How can I increase a scoreboard objective if player is at specific coords and has a specific item in his inventory?"

How can I increase a scoreboard objective if player is at specific coords and has a specific item in his inventory? - Woman cutting off adhesive tape from box with parcel
How can I increase a scoreboard objective if player is at specific coords and has a specific item in his inventory? - Unpacked boxes in middle of room
How can I increase a scoreboard objective if player is at specific coords and has a specific item in his inventory? - Open grey metal soda can



How do you add a scoreboard to an objective?

Scoreboard Command
  • To add an objective: /scoreboard objectives add <objective> <criteria> [displayName]
  • To remove an objective: /scoreboard objectives remove <objective>
  • To list all objectives: /scoreboard objectives list.
  • To set how the objectives are displayed: /scoreboard objectives setdisplay <slot> [objective]


  • How do you make a custom scoreboard in Minecraft?

    The other target selectors are \u201c@a\u201d for all players, \u201c@r\u201d for a random player, and \u201c@e\u201d will target all entities. Entities include everything that isn't a block, like monsters, snowballs, animals, and arrows. The command should execute successfully and give you a new block.



    Minecraft Scoreboard Operation Tutorial [1.16/1.17/1.18/1.19] How to Count Entities




    Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.

    Images: Karolina Grabowska, Liza Summer, Ketut Subiyanto, Karolina Grabowska