How to detect if a player is wearing a custom set of gear [duplicate]
I'm making a map in Minecraft with some custom crafting recipes that yield special items that deal with fighting. I know how to do that just fine, but I also want to add a bonus if one is wearing, say, a full set of "emerald armor." For example, if the player is wearing the full set, they would receive jump boost. So my question to you is: how do I detect if a player is wearing a specific set of gear? I know how to detect if a player is wearing a specific item with scoreboard and whatnot, but how do I combine those commands for a full set?
Best Answer
I know how to detect if a player is wearing a specific item with scoreboard and whatnot, but how do I combine those commands for a full set?
You could either put all of the data tags into one scoreboard objective, like this:
/scoreboard players set @a FullEmerald 0
/scoreboard players set @a FullEmerald 1 {Inventory:[{Slot:103b,<Helmet tags>},{Slot:102b,<Chestplate tags>}},{Slot:101b,<Leggings tags>}},{Slot:100b,<Boots tags>}}]}
Or, alternatively, set up an objective for each of the specific items, then combine them like:
@a[score_HelmetEmerald_min=1,score_ChestplateEmerald_min=1,score_LeggingsEmerald_min=1,score_BootsEmerald_min=1]
The second method would also really be better if you've already got objectives for each of the individual armor pieces (e.g: each piece individually has powers).
Pictures about "How to detect if a player is wearing a custom set of gear [duplicate]"
![How to detect if a player is wearing a custom set of gear [duplicate] - Man Wears White Crew-neck T-shirt Holding Camera on White Vehicle How to detect if a player is wearing a custom set of gear [duplicate] - Man Wears White Crew-neck T-shirt Holding Camera on White Vehicle](/assets/images/how_to_detect_if_a_player_is_wearing_a_custom_set_of_gear_duplicate_1.jpeg)
![How to detect if a player is wearing a custom set of gear [duplicate] - Standing Man Wearing White Dress Shirt Beside Two Men and White Sedan How to detect if a player is wearing a custom set of gear [duplicate] - Standing Man Wearing White Dress Shirt Beside Two Men and White Sedan](/assets/images/how_to_detect_if_a_player_is_wearing_a_custom_set_of_gear_duplicate_2.jpeg)
![How to detect if a player is wearing a custom set of gear [duplicate] - Man Looking at the Camera How to detect if a player is wearing a custom set of gear [duplicate] - Man Looking at the Camera](/assets/images/how_to_detect_if_a_player_is_wearing_a_custom_set_of_gear_duplicate_3.jpeg)
Minecraft 1.19 - Detect Item In Player's Off-Hand Or Armor Slots
Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.
Images: Kyle Loftus, Kyle Loftus, Kyle Loftus, Kyle Loftus
