All commands
🏷️
AdvancedJava Bedrock

/tag

Attach invisible labels to entities to target them later.

Overview

What is the /tag command?

The /tag command adds, removes and lists custom string tags on entities. Tags are free-form labels that don't change behaviour by themselves, but they're invaluable for selecting specific entities later with @e[tag=...].

They're the standard way datapacks 'mark' entities — flagging a boss, tracking which mobs have been processed, or grouping spawned entities.

When to use it: Use /tag to label entities with custom markers you can later target precisely with selectors.

At a glance

Syntax

Syntax
/tag <target> add <name>
commandtargetcoordsvaluerequiredoptional

See it

What it does

#raider#boss#wave2
Attaching invisible labels

Anatomy

Every part, explained

  1. 1
    /tagCommandRequired

    Adds or removes entity tags.

  2. 2
    <target>TargetRequired

    Which entity gets the tag.

  3. 3
    addActionRequired

    Use add, remove, or list.

  4. 4
    <name>Tag nameRequired

    The custom tag to apply.

Your turn

Try it yourself

Playground
4 tokens · press Enter to run

Copy & paste

Examples

/tag @s add winner

Tag yourself as winner.

/tag @e[type=zombie] add boss

Tag all zombies as boss.

/tag @s remove winner

Remove the winner tag.

Avoid these

Common mistakes

/tag add winner @s
/tag @s add winner

The target comes before the action.

/tag @s winner
/tag @s add winner

You must say add or remove.

Good to know

Frequently asked questions

How do you add a tag to an entity?
Run /tag <target> add <name>, e.g. /tag @e[type=zombie] add boss.
How do you select entities by tag?
Use the tag selector argument, e.g. /tp @e[tag=boss] ~ ~ ~ targets only entities with that tag.
How do you see an entity's tags?
Run /tag <target> list to print every tag currently on it.

Keep going

Related commands