1

This question already has an answer here:

I am trying to create a game where different potion effects are applied to a player depending on what armor the player is wearing (all of the armor is leather, but named and dyed). I know all of the ins and outs of it (test for a player wearing the gear sends out a signal which applies an effect), but how do I apply the affect to that player wearing the gear. Using @p or @a to specify wont work with multiple people as it will specify everyone or anyone.

marked as duplicate by ModDL, Schism, Mathias711, kalina, MrLemon Nov 26 '15 at 9:54

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1

Use scoreboard to keep track of players wearing the gear.

Setup:

/scoreboard objective set isTarget dummy

Clock:

/scoreboard players set @a isTarget 0
/scoreboard players set @a isTarget 1 {Inventory:[{Slot:<Slot>,id:<Item>}]}
/effect @a[score_isTarget_min=1]

Slot is the slot that you wish to search. Head armor slot is 103 and going in decreasing order to foot 100. Id is the item you want to test for.

  • @Furogun if this answer solved your problem, please click the check mark under the score of the answer to accept it. – ModDL Nov 26 '15 at 1:23

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