/tag
Adds, removes, or lists tags on entities. Tags are simple string labels used for entity selection and organization.
Syntax
/tag <targets> <add|list|remove> <name>Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| targets | entity | Required | The entity or entities to modify. |
| action | literal | Required | add, list, or remove. |
| name | string | Required | The tag name to add or remove. Not needed for list. |
Examples
/tag @s add vipAdds the tag "vip" to yourself.
/tag @e[type=villager] add protectedTags all villagers with "protected".
/tag @p listLists all tags on the nearest player.
Common Mistakes
- Using spaces in tag names, tag names cannot contain spaces.
- Confusing tags with scoreboard objectives, tags are binary (present or not), while scoreboards hold numeric values.
Notes
Tags are stored as a list in the entity's NBT data. They can be used in selectors with tag= or tag=!. An entity can have multiple tags. Tags are useful for grouping entities for targeting.
Related Commands
Need a Minecraft server?
Try these commands on Astroworld or host your own server.
Try Astroworld Hosting