Minecraft:Commands/tag: Difference between revisions
More actions
Remove broken links to missing pages |
Fix template calls: add MC/ prefix |
||
| Line 1: | Line 1: | ||
{{ | {{MC/For||Tag}} | ||
{{Infobox command | {{Infobox command | ||
| name = tag | | name = tag | ||
| Line 8: | Line 8: | ||
}} | }} | ||
Controls scoreboard tags on individual entities. {{ | Controls scoreboard tags on individual entities. {{MC/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. | ||
== Syntax == | == Syntax == | ||
| Line 30: | Line 30: | ||
== Arguments == | == Arguments == | ||
{{ | {{MC/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}}}} | ||
: {{ | : {{MC/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}} | ||
: 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}} | ||
== Result == | == Result == | ||
| Line 52: | Line 52: | ||
== Output == | == Output == | ||
{{Output table}} | {{MC/Output table}} | ||
{{Output table|edition=je|On fail|0|0|0}} | {{MC/Output table|edition=je|On fail|0|0|0}} | ||
{{Output table|cmd=/tag ... add ...|On success|1|1|the number of entities who get a new tag}} | {{MC/Output table|cmd=/tag ... add ...|On success|1|1|the number of entities who get a new tag}} | ||
{{Output table|cmd=/tag ... remove ...|On success|1|1|the number of entities whose tag is remove}} | {{MC/Output table|cmd=/tag ... remove ...|On success|1|1|the number of entities whose tag is remove}} | ||
{{Output table|cmd=/tag ... list|On success|1|1|the number of all tags the specified entities have}} | {{MC/Output table|cmd=/tag ... list|On success|1|1|the number of all tags the specified entities have}} | ||
{{Output table|cmd=|edition=be|On fail|0}} | {{MC/Output table|cmd=|edition=be|On fail|0}} | ||
{{Output table|On success|1}} | {{MC/Output table|On success|1}} | ||
{{Output table}} | {{MC/Output table}} | ||
== History == | == History == | ||
=== ''Java Edition'' === | === ''Java Edition'' === | ||
{{HistoryTable | {{HistoryTable | ||
|{{HistoryLine|java}} | |{{MC/HistoryLine|java}} | ||
|{{HistoryLine||1.13|dev=17w45a|Added {{ | |{{HistoryLine||1.13|dev=17w45a|Added {{MC/Cmd|tag|link=none}}.}} | ||
}} | }} | ||
=== ''Bedrock Edition'' === | === ''Bedrock Edition'' === | ||
{{HistoryTable | {{HistoryTable | ||
|{{HistoryLine|bedrock}} | |{{MC/HistoryLine|bedrock}} | ||
|{{HistoryLine||1.9|dev=beta 1.9.0.2|Added {{ | |{{HistoryLine||1.9|dev=beta 1.9.0.2|Added {{MC/Cmd|tag|link=none}}.}} | ||
}} | }} | ||
== See also == | == See also == | ||
* {{ | * {{MC/Cmd|function}} | ||
* {{ | * {{MC/Cmd|team}} | ||
== External links == | == External links == | ||
| Line 82: | Line 82: | ||
== Navigation == | == Navigation == | ||
{{Navbox commands}} | {{MC/Navbox commands}} | ||
de:Befehl/tag | de:Befehl/tag | ||
Latest revision as of 20:14, 9 April 2026
Template:Hatnote Template:Infobox command
Controls scoreboard tags on individual entities. in Template:Editions, the number of tags owned by an entity cannot exceed 1024.
- REDIRECT Template:Edition
Template:Rcat 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:El: <targets>: entity
Template:El: entity: target: WildcardCommandSelector<Actor>
- Specifies the command's target.
- in Template:Editions, {{#vardefine:onlyje|}}{{#vardefine:onlybe| Template:IN,}}{{#vardefine:je-arg|entity}}{{#vardefine:be-arg|}}Template:Error{{#vardefine:onlyje|}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|}}
- in Template:Editions, must be either a target selector, a player name, or
*for all score holders.
Template:El: <name>: string
Template:El: name: string: basic_string
- Specifies the name of the tag to be added into or removed from the targets.
- {{#vardefine:onlyje|Template:IN,}}{{#vardefine:onlybe| Template:IN,}}{{#vardefine:je-arg|string}}{{#vardefine:be-arg|string}}Template:Error{{#vardefine:onlyje|}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|}}
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
{{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-table-lines|-2}}{{#vardefine:output-table-lines-now|}}{{#vardefine:command-num-now|}}{{#vardefine:command-line-now|}}{{#vardefine:commands-num|}}{{#vardefine:output-edition-num-now|}}{{#vardefine:output-edition-line-now|}}{{#vardefine:output-editions-num|}}{{#vardefine:je-outputs-dis|}}
{{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:situation-{{#var:output-table-lines}}|On fail}}{{#vardefine:output1-{{#var:output-table-lines}}|0}}{{#vardefine:output2-{{#var:output-table-lines}}|0}}{{#vardefine:output3-{{#var:output-table-lines}}|0}}{{#vardefine:command-row-{{#var:commands-num}}|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-editions-num|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-edition-{{#var:output-editions-num}}|je}}{{#vardefine:output-edition-row-{{#var:output-editions-num}}|1}}
{{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:situation-{{#var:output-table-lines}}|On success}}{{#vardefine:output1-{{#var:output-table-lines}}|1}}{{#vardefine:output2-{{#var:output-table-lines}}|1}}{{#vardefine:output3-{{#var:output-table-lines}}|the number of entities who get a new tag}}{{#vardefine:commands-num|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:command-{{#var:commands-num}}|/tag ... add ...}}{{#vardefine:command-row-{{#var:commands-num}}|1}}{{#vardefine:output-edition-row-{{#var:output-editions-num}}|Expression error: Unrecognized punctuation character "{".}}
{{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:situation-{{#var:output-table-lines}}|On success}}{{#vardefine:output1-{{#var:output-table-lines}}|1}}{{#vardefine:output2-{{#var:output-table-lines}}|1}}{{#vardefine:output3-{{#var:output-table-lines}}|the number of entities whose tag is remove}}{{#vardefine:commands-num|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:command-{{#var:commands-num}}|/tag ... remove ...}}{{#vardefine:command-row-{{#var:commands-num}}|1}}{{#vardefine:output-edition-row-{{#var:output-editions-num}}|Expression error: Unrecognized punctuation character "{".}}
{{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:situation-{{#var:output-table-lines}}|On success}}{{#vardefine:output1-{{#var:output-table-lines}}|1}}{{#vardefine:output2-{{#var:output-table-lines}}|1}}{{#vardefine:output3-{{#var:output-table-lines}}|the number of all tags the specified entities have}}{{#vardefine:commands-num|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:command-{{#var:commands-num}}|/tag ... list}}{{#vardefine:command-row-{{#var:commands-num}}|1}}{{#vardefine:output-edition-row-{{#var:output-editions-num}}|Expression error: Unrecognized punctuation character "{".}}
{{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:situation-{{#var:output-table-lines}}|On fail}}{{#vardefine:output1-{{#var:output-table-lines}}|0}}{{#vardefine:output2-{{#var:output-table-lines}}|N/A}}{{#vardefine:output3-{{#var:output-table-lines}}|N/A}}{{#vardefine:commands-num|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:command-{{#var:commands-num}}|Any}}{{#vardefine:command-row-{{#var:commands-num}}|1}}{{#vardefine:output-editions-num|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-edition-{{#var:output-editions-num}}|be}}{{#vardefine:output-edition-row-{{#var:output-editions-num}}|1}}
{{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:situation-{{#var:output-table-lines}}|On success}}{{#vardefine:output1-{{#var:output-table-lines}}|1}}{{#vardefine:output2-{{#var:output-table-lines}}|N/A}}{{#vardefine:output3-{{#var:output-table-lines}}|N/A}}{{#vardefine:command-row-{{#var:commands-num}}|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-edition-row-{{#var:output-editions-num}}|Expression error: Unrecognized punctuation character "{".}}
{{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-table-lines|-2}}{{#vardefine:output-table-lines-now|}}{{#vardefine:command-num-now|}}{{#vardefine:command-line-now|}}{{#vardefine:commands-num|}}{{#vardefine:output-edition-num-now|}}{{#vardefine:output-edition-line-now|}}{{#vardefine:output-editions-num|}}{{#vardefine:je-outputs-dis|}}
History
Java Edition
Bedrock Edition
See also
- REDIRECT Template:Command
- REDIRECT Template:Command
External links
de:Befehl/tag ja:コマンド/tag pt:Comandos/tag ru:Команды консоли/tag zh:命令/tag