From Minecraft Wiki
Java Edition only
|This page contains content on features that may be included in the next update.
These features have appeared in development versions, but the full update containing these features has not been released yet.
Controls entity tags.
tag <targets> add <name>
tag <targets> list
tag <targets> remove <name>
- A target selector.
- Specifies the name of the tag to be added into or removed from the targets.
- Fails if the arguments are not specified correctly.
- On success:
add— Adds a tag to the targets.
list— Lists all tags on the targets.
remove— Removes a tag from the targets.