Minecraft:Commands/datapack: Difference between revisions
More actions
Remove broken links to missing pages |
Fix template calls: add MC/ prefix |
||
| Line 1: | Line 1: | ||
{{ | {{MC/Distinguish|Commands/data}} | ||
{{ | {{MC/Exclusive|java}} | ||
{{Infobox command | {{Infobox command | ||
|name=datapack | |name=datapack | ||
| Line 31: | Line 31: | ||
==Arguments== | ==Arguments== | ||
{{ | {{MC/Argument|name|string}} | ||
: Specifies the name of the data pack. | : Specifies the name of the data pack. | ||
: {{ | : {{MC/Arg desc|je=string|type=phrase}} | ||
{{ | {{MC/Argument|existing|string}} | ||
: Specifies the name of an existing enabled data pack. | : Specifies the name of an existing enabled data pack. | ||
: {{ | : {{MC/Arg desc|je=string|type=phrase}} | ||
{{ | {{MC/Argument|id|string}} | ||
: Created pack name, must be a valid directory name. | : Created pack name, must be a valid directory name. | ||
: {{ | : {{MC/Arg desc|je=string|type=phrase}} | ||
{{ | {{MC/Argument|description|string}} | ||
: text component to be placed in description in <code>pack.mcmeta</code>. | : text component to be placed in description in <code>pack.mcmeta</code>. | ||
: {{ | : {{MC/Arg desc|je=string|type=phrase}} | ||
==Result== | ==Result== | ||
| Line 60: | Line 60: | ||
== 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=/datapack enable ...<br>/datapack disable ...|On success|1|1|The number of packs that are loaded after executing.}} | {{MC/Output table|cmd=/datapack enable ...<br>/datapack disable ...|On success|1|1|The number of packs that are loaded after executing.}} | ||
{{Output table|cmd=/datapack list [available{{!}}enabled]|On success|1|1|the number of data packs that are listed}} | {{Output table|cmd=/datapack list [available{{!}}enabled]|On success|1|1|the number of data packs that are listed}} | ||
{{Output table}} | {{MC/Output table}} | ||
== History == | == History == | ||
{{HistoryTable | {{HistoryTable | ||
|{{HistoryLine|java}} | |{{MC/HistoryLine|java}} | ||
|{{HistoryLine||1.13|dev=17w46a|Added {{ | |{{HistoryLine||1.13|dev=17w46a|Added {{MC/Cmd|datapack|link=none}}.}} | ||
|{{HistoryLine||1.19.3|dev=22w42a|Added feature flags. Data pack requiring feature flag that is not enabled cannot load by this command now.}} | |{{MC/HistoryLine||1.19.3|dev=22w42a|Added feature flags. Data pack requiring feature flag that is not enabled cannot load by this command now.}} | ||
|{{HistoryLine||1.20.5|dev=24w11a|<code>/datapack disable</code> doesn't work in this snapshot.<ref>{{bug|MC-269373|||fixed}}</ref>}} | |{{HistoryLine||1.20.5|dev=24w11a|<code>/datapack disable</code> doesn't work in this snapshot.<ref>{{bug|MC-269373|||fixed}}</ref>}} | ||
|{{HistoryLine|||dev=24w12a|If a built-in datapack in the path of <code>datapacks</code> in the vanilla datapack folder is enabled during world creation, it can no longer be disabled by this command.}} | |{{MC/HistoryLine|||dev=24w12a|If a built-in datapack in the path of <code>datapacks</code> in the vanilla datapack folder is enabled during world creation, it can no longer be disabled by this command.}} | ||
|{{HistoryLine||1.21.6|dev=25w15a|Added {{ | |{{HistoryLine||1.21.6|dev=25w15a|Added {{MC/Cmd|datapack create|link=none}}.}} | ||
}} | }} | ||
| Line 81: | Line 81: | ||
== Navigation == | == Navigation == | ||
{{Navbox commands}} | {{MC/Navbox commands}} | ||
de:Befehl/datapack | de:Befehl/datapack | ||
Latest revision as of 20:09, 9 April 2026
Template:Hatnote Script error: No such module "Exclusive". Template:Infobox command
Controls the loading/unloading of data packs.
Note that feature flags can be enabled through data pack only when creating the world. Data packs requiring a feature flag that is not enabled cannot be loaded by this command.
If a built-in datapack in the path of datapacks in the vanilla datapack is enabled during world creating, it cannot be disabled by this command.
Syntax
datapack disable <name>- Disable the specified pack.
datapack enable <name>- Load the specified pack.
datapack enable <name> (first|last)- Load this pack before (lowest priority) or after (highest priority) all others (lowest or highest priority).
datapack enable <name> (before|after) <existing>- Load this pack just before (lower priority) or after (higher priority) an existing pack.
datapack list [available|enabled]- List all data packs, or list only the available/enabled ones. Hovering over the data packs in the chat output shows their description defined in their
pack.mcmeta.
- List all data packs, or list only the available/enabled ones. Hovering over the data packs in the chat output shows their description defined in their
datapack create <id> <description>- Creates new empty directory data pack for current world.
Arguments
<name>: string
- Specifies the name of the data pack.
- {{#vardefine:onlyje|}}{{#vardefine:onlybe| Template:IN,}}{{#vardefine:je-arg|string}}{{#vardefine:be-arg|}}Template:Error{{#vardefine:onlyje|}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|}}
<existing>: string
- Specifies the name of an existing enabled data pack.
- {{#vardefine:onlyje|}}{{#vardefine:onlybe| Template:IN,}}{{#vardefine:je-arg|string}}{{#vardefine:be-arg|}}Template:Error{{#vardefine:onlyje|}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|}}
<id>: string
- Created pack name, must be a valid directory name.
- {{#vardefine:onlyje|}}{{#vardefine:onlybe| Template:IN,}}{{#vardefine:je-arg|string}}{{#vardefine:be-arg|}}Template:Error{{#vardefine:onlyje|}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|}}
<description>: string
- text component to be placed in description in
pack.mcmeta. - {{#vardefine:onlyje|}}{{#vardefine:onlybe| Template:IN,}}{{#vardefine:je-arg|string}}{{#vardefine:be-arg|}}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 packs that are loaded after executing.}}{{#vardefine:commands-num|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:command-{{#var:commands-num}}|/datapack enable ...}}{{#vardefine:command-row-{{#var:commands-num}}|1}}{{#vardefine:output-edition-row-{{#var:output-editions-num}}|Expression error: Unrecognized punctuation character "{".}}
Template:Output table
/datapack disable ...
{{#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
References
<references/>
de:Befehl/datapack es:Comandos/datapack ja:コマンド/datapack pt:Comandos/datapack ru:Команды консоли/datapack th:คำสั่ง/datapack zh:命令/datapack