So I'm making a kind of kit PVP game called classes, where you join a team, let's say, the barbarian. You can't hit any other barbarians, and it shows everyone else with the same class. But I want people with certain classes to have special effects how do I do that?

I tried:

/effect 1 1000000 5 @a[barbarian]

But it didn't work. I am running 1.9

  • Check the wikis before posting an answer. http://minecraft.gamepedia.com/Commands#Target_selector_arguments would have told you what you were doing wrong. Mar 4, 2016 at 19:50
  • I'm sorry. I looked everywhere for the answer but I could not find it no matter how hard I tried. Thanks for the link!
    – Kylun11
    Mar 5, 2016 at 17:47
  • If you're ever wondering anything about minecraft, the minecraft wiki might just be the place to look :P Mar 5, 2016 at 18:41

2 Answers 2


Selector parameters consist of a unique key name and a value, separated by an equals sign, with each unique parameter separated by a comma. The team parameter is what allows you to target players based on their team. For the /effect command, the target comes first:

/effect <player> <effect> [seconds] [amplifier] [hideParticles]
/effect @a[team=barbarian] minecraft:speed 1000000 5

See also, Minecraft Wiki: Target selector arguments.


/effect @a[team=teamname] 1 1000000 5 would set an effect to all players on a certain team, where teamname is the name of the team that you want to give the effect to.

  • What was wrong with this answer? Is there anything that I need to add? @Kylun11 Mar 5, 2016 at 20:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .