/tag
Manages arbitrary string tags attached to entities. Tags are invisible labels you can filter on with the tag= selector argument, making them the standard way to track state across command blocks and datapack functions without scoreboards.
What is /tag used for?
What /tag is for
Adds, removes, or lists invisible string tags on entities — labels you can later filter on with the tag= selector argument.
When to use /tag
Track state without scoreboards: mark which mobs belong to an event, flag players who've triggered something, or group entities for a follow-up command.
Tips for /tag
Select tagged entities with @e[tag=name] and untagged ones with @e[tag=!name]. Tags are free-form strings — no setup needed before you add one.
Syntax
Parameters
- targets
- entity selector
- Entities to tag.
- action
- literal
- add / remove / list.
- nameoptional
- string
- Tag name (required for add/remove).
Command builder
Fill in the options below to generate a ready-to-paste /tag command.
Entities to tag.
add / remove / list.
Tag name (required for add/remove).
Examples
Give yourself the tag 'chosen'.
Tag every zombie as a raid mob.
Use the tag in a selector to remove them later.
Common questions
How do I select entities by tag?
Use the tag= selector argument: @e[tag=chosen] matches entities with the tag, and @e[tag=!chosen] matches those without it.
Permission level
/tag requires Cheats (op level 2). In single-player you need the world's "Allow Cheats" toggle on. On a multiplayer server you need to be opped — see /op.