/tag
Adds, removes, or lists tags on entities. Tags are simple string labels used for entity selection and organization.
Overview
Adds, removes, or lists tags on entities. Tags are simple string labels used for entity selection and organization. In vanilla Minecraft Java Edition it is one of the data commands and has been available since version 1.13.
It is invoked as /tag and accepts 3 required arguments (
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.
Tags are boolean labels stored in an entity's NBT and selectable with tag= or tag=! in selectors. They hold no value — use a scoreboard objective when you need a number.
Syntax & Arguments
/tag <targets> <add|list|remove> <name>The full syntax is /tag . Angle brackets < > mark required arguments and square brackets [ ] mark optional ones; a vertical bar | between words means you pick exactly one of those literals. You must always supply
- targets
- Required, of type an entity. The entity or entities to modify.
- action
- Required, of type a literal. add, list, or remove.
- name
- Required, of type a string. The tag name to add or remove. Not needed for list.
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
The 3 examples below are ready to copy and adapt. For instance, /tag @s add vip adds the tag "vip" to yourself. Each example varies the arguments to show a different real use of /tag; read the note under every snippet to see exactly what changes.
/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.
Permission Level & Requirements
/tag sits at permission Level 2 - Game Master / Cheats, which means it needs permission level 2, the level cheats grant to single-player worlds and that operators hold by default.
In a single-player world you must have "Allow Cheats" turned on (or open the world to LAN with cheats) before it will run; on a multiplayer server the player needs to be an operator at the matching level.
This reference describes the Java Edition 1.21 form of the command; Bedrock Edition may use slightly different argument formats.
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
If /tag is part of your toolkit, the commands below are the ones you will most often reach for alongside it: /scoreboard, /team, and /data. They cover closely related tasks, so the links above jump straight to each one.
Frequently Asked Questions about /tag
What does the /tag command do in Minecraft?
Adds, removes, or lists tags on entities. Tags are simple string labels used for entity selection and organization. It belongs to the data command group and was added in Java Edition 1.13.
What is the correct syntax for /tag?
/tag
What permission level does /tag need?
It requires permission Level 2 - Game Master / Cheats. On a server the player must be an operator at that level, or have cheats enabled in single-player.
What is a common mistake when using /tag?
Using spaces in tag names, tag names cannot contain spaces.
Can you give an example of /tag in use?
Yes. /tag @e[type=villager] add protected — tags all villagers with "protected".
Need a Minecraft server?
Try these commands on Astroworld or host your own server.
Try Astroworld Hosting