Updated:
The basic form
| Goal | Command |
|---|---|
| Add a tag | /tag @s add player |
| Remove it | /tag @s remove player |
| List tags | /tag @s list |
Same on Java and Bedrock. Tag names cannot contain spaces; letters and numbers are safest.
Select by tag
/effect give @a[tag=player] minecraft:speed 30 1
/tp @a[tag=!player] 0 64 0
[tag=name] picks entities with the tag; [tag=!name] picks those without it. The first line speeds up participants, the second sends everyone else to spawn.
Minigame sign-up
/tag @a[distance=..5] add player
/give @a[tag=player] minecraft:wooden_sword
/tag @a remove player
Tag everyone near the sign-up point, give only them equipment, and remove the tag when the game ends. Tags never expire on their own.
Combine tags
/effect give @a[tag=player,tag=!out] minecraft:glowing 10 0
Several tag= conditions must all match: this highlights participants who are not out yet. Mark eliminated players with /tag @s add out.
Run something once per player
execute as @a[tag=!welcomed] run tellraw @s {"text":"Welcome!","color":"gold"}
tag @a[tag=!welcomed] add welcomed
In a repeating block followed by a chain block, each new player gets the message once and is then tagged. The same pattern works for first-join rewards.
Tag mobs when you summon them
| Version | Command |
|---|---|
| Java | /summon minecraft:zombie ~ ~ ~ {Tags:["boss"]} |
| Bedrock | /summon zombie ~ ~ ~ then /tag @e[type=zombie,c=1] add boss |
Afterwards /kill @e[tag=boss] targets only that mob.
Common problems
- Nobody is selected: tag names are case-sensitive; check with
/tag @s list. - Adding twice does nothing: a tag is either there or not.
- Tags after death: players keep their tags; killed mobs are gone along with theirs.
- Tags vs teams: a player has one team but any number of tags (up to 1024).
Check your command
The Command Error Doctor checks common syntax mistakes in your browser.