/tag @p add myTagAdd a tag to the target
Tag names cannot contain spaces. Use underscores or camelCase.
The /tag command manages scoreboard tags on entities. Tags can be used in target selectors like @e[tag=myTag] for precise targeting in commands and data packs. Each entity can have up to 1024 tags.
The /tag command attaches custom string labels to entities: players, mobs, items, anything with an entity ID. These labels have no inherent meaning; you define what they represent. This generator builds the syntax for add, remove, and list operations on any entity target.
The syntax is /tag [targets] add|remove|list [name]. Tags are arbitrary strings without spaces that you create. An entity can carry multiple tags at once, and they persist in the entity NBT data until explicitly removed.
Tags are the backbone of entity management in command systems and data packs. You mark specific entities, then reference them later with the tag= selector argument. Combined with /execute, tags become a clean way to build conditional logic around any entity in the game.
| Syntax | Effect |
|---|---|
| /tag <target> add <name> | Attaches a tag to the target. If it already has the tag, nothing happens (no error, no duplicate). |
| /tag <target> remove <name> | Detaches a tag from the target. Fails silently if the tag is not present. |
| /tag <target> list | Displays all tags currently attached to the target entity in chat. |
Tag name rules: any string without spaces works. The convention is lowercase with underscores, for example boss_fight_active, so tags stay readable across a data pack.
The real power of tags comes from the tag= selector argument. Once an entity is tagged, you can reference it from any other command.
| Selector | Selects |
|---|---|
| @e[tag=boss] | All entities with the boss tag |
| @e[tag=!boss] | All entities without the boss tag |
| @e[tag=enemy,tag=!dead] | Entities tagged enemy but not tagged dead |
| @a[tag=team_red] | All players with the team_red tag |
| @e[tag=] | All entities with no tags at all |
Tag vs scoreboard: tags are boolean, so an entity either has a tag or it does not. Scoreboards store numeric values. Use tags for state flags such as team membership or has_visited_area, and scoreboards for tracking numbers such as kills, points, and timers.
The /tag command manages custom string labels on entities. It has three operations: add attaches a tag, remove detaches a tag, and list shows all tags on an entity. Tags are arbitrary strings you define. Entities can have multiple tags, and tags persist until removed.
Use the tag= argument in target selectors to filter entities. For example, @e[tag=boss] selects all entities with the boss tag. Use tag=!boss to select entities without it. You can combine multiple filters: @e[tag=enemy,tag=!dead] selects entities tagged enemy but not dead.
There is no hard limit on the number of tags per entity in vanilla Minecraft. Tags are stored in NBT data, so extremely large numbers can impact performance. In practice, most data packs use fewer than 10 tags per entity.
Tags are boolean: an entity either has a tag or does not. Scoreboards store integer values. Use tags for state flags such as team membership or quest progress, and scoreboards for numeric tracking such as kills, points, or timers.
Browse more Minecraft tools: