Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Minecraft:Commands/tag: Difference between revisions

From SAS Gaming Wiki
SyncBot (talk | contribs)
Fix template calls: add MC/ prefix
SyncBot (talk | contribs)
Sync: updated from Minecraft
 
Line 1: Line 1:
{{MC/For||Tag}}
{{for||Tag}}
{{Infobox command
{{Infobox command
| name = tag
| name = tag
Line 5: Line 5:
* 2 {{only|java|short=1}}
* 2 {{only|java|short=1}}
* 1 {{only|bedrock|short=1}}
* 1 {{only|bedrock|short=1}}
| others = Cheat only{{only|bedrock|short=1}}
| others = [[Minecraft:Cheat]] only{{only|bedrock|short=1}}
}}
}}


Controls scoreboard tags on individual entities. {{MC/In|java}}, the number of tags owned by an entity cannot exceed 1024.
Controls [[Minecraft:scoreboard tag]]s on individual [[Minecraft:entities]]. {{IN|java}}, the number of tags owned by an entity cannot exceed 1024.


{{MC/El|je}} note: This is distinct from entity type tags, which are applied to entity types and can't be changed by commands.
{{el|je}} note: This is distinct from [[Minecraft:tags|entity type tags]], which are applied to [[Minecraft:Entity#Types of entities|entity types]] and can't be changed by commands.


== Syntax ==
== Syntax ==
Line 30: Line 30:


== Arguments ==
== Arguments ==
{{MC/Argument|targets|entity|entity: target|WildcardCommandSelector<Actor>}}
{{argument|targets|entity|entity: target|WildcardCommandSelector<Actor>}}
: Specifies the command's target.
: Specifies the command's target.
: {{MC/In|java}}, {{lcfirst:{{MC/Arg desc|je=entity|amount=multiple|type=entities}}}}
: {{IN|java}}, {{lcfirst:{{arg desc|je=entity|amount=multiple|type=entities}}}}
: {{MC/In|bedrock}}, must be either a [[Minecraft:Commands#Target_selectors|target selector]], a player name, or <code>*</code> for all score holders.
: {{IN|bedrock}}, must be either a [[Minecraft:Commands#Target_selectors|target selector]], a player name, or <code>*</code> for all score holders.


{{MC/Argument|name|string|name: string|basic_string}}
{{argument|name|string|name: string|basic_string}}
: Specifies the name of the tag to be added into or removed from the targets.
: Specifies the name of the tag to be added into or removed from the targets.
: {{MC/Arg desc|je=string|type=word|be=string}}
: {{arg desc|je=string|type=word|be=string}}


== Result ==
== Result ==
Line 52: Line 52:


== Output ==
== Output ==
{{MC/Output table}}
{{Output table}}
{{MC/Output table|edition=je|On fail|0|0|0}}
{{Output table|edition=je|On fail|0|0|0}}
{{MC/Output table|cmd=/tag ... add ...|On success|1|1|the number of entities who get a new tag}}
{{Output table|cmd=/tag ... add ...|On success|1|1|the number of entities who get a new tag}}
{{MC/Output table|cmd=/tag ... remove ...|On success|1|1|the number of entities whose tag is remove}}
{{Output table|cmd=/tag ... remove ...|On success|1|1|the number of entities whose tag is remove}}
{{MC/Output table|cmd=/tag ... list|On success|1|1|the number of all tags the specified entities have}}
{{Output table|cmd=/tag ... list|On success|1|1|the number of all tags the specified entities have}}
{{MC/Output table|cmd=|edition=be|On fail|0}}
{{Output table|cmd=|edition=be|On fail|0}}
{{MC/Output table|On success|1}}
{{Output table|On success|1}}
{{MC/Output table}}
{{Output table}}


== History ==
== History ==
=== ''Java Edition'' ===
=== ''Java Edition'' ===
{{HistoryTable
{{HistoryTable
|{{MC/HistoryLine|java}}
|{{HistoryLine|java}}
|{{HistoryLine||1.13|dev=17w45a|Added {{MC/Cmd|tag|link=none}}.}}
|{{HistoryLine||1.13|dev=17w45a|Added {{cmd|tag|link=none}}.}}
}}
}}


=== ''Bedrock Edition'' ===
=== ''Bedrock Edition'' ===
{{HistoryTable
{{HistoryTable
|{{MC/HistoryLine|bedrock}}
|{{HistoryLine|bedrock}}
|{{HistoryLine||1.9|dev=beta 1.9.0.2|Added {{MC/Cmd|tag|link=none}}.}}
|{{HistoryLine||1.9|dev=beta 1.9.0.2|Added {{cmd|tag|link=none}}.}}
}}
}}


== See also ==
== See also ==
* {{MC/Cmd|function}}
* {{cmd|function}}
* {{MC/Cmd|team}}
* {{cmd|team}}


== External links ==
== External links ==
Line 82: Line 82:


== Navigation ==
== Navigation ==
{{MC/Navbox commands}}
{{Navbox commands}}


de:Befehl/tag
[[Minecraft:de:Befehl/tag]]
ja:コマンド/tag
[[Minecraft:fr:Commandes/tag]]
pt:Comandos/tag
[[Minecraft:ja:コマンド/tag]]
ru:Команды консоли/tag
[[Minecraft:pt:Comandos/tag]]
zh:命令/tag
[[Minecraft:ru:Команды консоли/tag]]
[[Minecraft:zh:命令/tag]]

Latest revision as of 11:08, 29 July 2026

Template:For Template:Infobox command

Controls Minecraft:scoreboard tags on individual Minecraft:entities. Template:IN, the number of tags owned by an entity cannot exceed 1024.

Template:El note: This is distinct from entity type tags, which are applied to entity types and can't be changed by commands.

Syntax

  • Java Edition
tag <targets> add <name>
Adds a tag to the targets.
tag <targets> remove <name>
Removes a tag from the targets.
tag <targets> list
Lists all tags on the targets.
  • Bedrock Edition
tag <entity: targets> add <name: string>
Adds a tag to the targets.
tag <entity: targets> remove <name: string>
Removes a tag from the targets.
tag <entity: targets> list
Lists all tags on the targets.

Arguments

Template:Argument

Specifies the command's target.
Template:IN, Template:Arg desc
Template:IN, must be either a target selector, a player name, or * for all score holders.

Template:Argument

Specifies the name of the tag to be added into or removed from the targets.
Template:Arg desc

Result

Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table

Output

Template:Output table Template:Output table Template:Output table Template:Output table Template:Output table Template:Output table Template:Output table Template:Output table

History

Java Edition

Template:HistoryTable

Bedrock Edition

Template:HistoryTable

See also

External links

Navigation

Template:Navbox commands

Minecraft:de:Befehl/tag Minecraft:fr:Commandes/tag Minecraft:ja:コマンド/tag Minecraft:pt:Comandos/tag Minecraft:ru:Команды консоли/tag Minecraft:zh:命令/tag