Add an Entity to a Team in Minecraft 1.11

If you're tired of getting attacked by mobs in Minecraft, there's a neat trick to stop it. You can use a Command Block to add entities of particular types to your team, which will stop many of them from attacking you.

Steps

  1. Set your gamemode to Creative /gamemode 1, and have cheats enabled.
    • If cheats aren't enabled, press Escape and then click on Open to LAN, turning cheats On first.
    • These steps are only guaranteed to work on Minecraft PC 1.11.x.
  2. Type /scoreboard teams add (your team name) into the command bar.
    • Eg:  /scoreboard teams add Elektrosonikai
  3. Type /scoreboard teams join (your team name) (your player name).
    • Eg:  /scoreboard teams join Elektrosonikai Elektrosonix
  4. Type this command:.
    • /give (your player name) minecraft:repeating_command_block
    • Eg: /give Elektrosonix minecraft:repeating_command_block
    • The reason why you are using a repeating command block is because the command has to be affecting the mobs constantly in order to affect new ones that spawn in. If you don't care about new mobs, a repeating command block is not necessary.
  5. Build (or place) the command block anywhere.
  6. Right click on the command block, opening the interface.
  7. In the bar labeled "Console Command", type /scoreboard teams join (your team name) (entity).
    • Eg: /scoreboard teams join Elektrosonikai @e[type=wither_skeleton]
  8. Find the three buttons side-by-side below "Console Command".  They should be set to read the following: Repeat, Unconditional, and Always Active.
  9. Enjoy the results. No matter what gamemode you are in, the mob you chose (Wither Skeletons in the example) should be incapable of attacking you.  Success!

Tips

  • The repeating command block is going to fill up the chat window. To stop this, type /gamerule commandBlockOutput false. This means that all command blocks can't affect chat unless they use the "/say" command.
  • Every single entity of this type is going to be affected by these commands.

Warnings

  • Some mobs are immune to this command (who knows why). For example, Magma Cubes, Slimes, and Evokers will still attack all players. Interestingly, though Evokers are immune, Vexes are still affected and won't attack their teammates. No friendly fire!