Il datapack non si carica? La struttura delle cartelle e i tre nomi che devono corrispondere
Un datapack che non compare in /datapack list ha un problema di percorso, non di codice. Ecco l'albero esatto, la regola del namespace e le cartelle rinominate.
/datapack list shows nothing, or shows the pack as disabled. Almost always the JSON is fine and the folders are wrong.
L'albero
world/datapacks/my_pack/
├── pack.mcmeta
└── data/
└── my_namespace/
├── function/ one .mcfunction per file
├── recipe/
├── loot_table/
├── advancement/
├── predicate/
└── tags/
└── function/
└── load.json
Tre nomi devono coincidere e uno di essi non è ovvio:
pack.mcmetaat the pack root — accanto adata/, not inside it.data/<namespace>/— il tuo namespace, in minuscolo, senza spazi. Questo diventa il prefisso
in my_namespace:my_function.
- I nomi delle cartelle di categoria, che sono cambiati e sono i soliti colpevoli.
Le cartelle sono state rinominate al singolare
Ciò ha reso incompatibili molti pacchetti e molti tutorial:
| Vecchio | Attuale |
|---|---|
functions/ | function/ |
recipes/ | recipe/ |
loot_tables/ | loot_table/ |
advancements/ | advancement/ |
predicates/ | predicate/ |
structures/ | structure/ |
Un pacchetto che usa i nomi plurali si carica: appare in /datapack list — and simply does nothing, which is the most confusing failure mode of the set. tags/ stayed plural, and so did tags/function/ becoming singular inside it. Yes, that is inconsistent.
Eseguire qualcosa automaticamente
Due tag speciali:
data/minecraft/tags/function/load.json → runs once on load/reload
data/minecraft/tags/function/tick.json → runs every tick
Nota data/minecraft/, non il tuo namespace: il tag appartiene a Minecraft, le funzioni a cui punta appartengono a te:
{ "values": ["my_namespace:setup"] }
Diagnosi in ordine
/datapack list— if the pack is not listed at all,pack.mcmetais missing,
malformato, o un livello troppo profondo.
- In elenco ma disabilitato —
/datapack enable "file/my_pack". Note thefile/prefix
e le virgolette.
- In elenco e abilitato ma inerte: errato
pack_format, or plural folder names. /reloadand read the chat. Syntax errors in functions surface there, not silently.
Compresso o no
Entrambi funzionano. Compresso significa pack.mcmeta at the radice dello zip, esattamente come per i resource pack. In formato cartella è più semplice durante lo sviluppo perché /reload picks up edits without re-zipping.
Posizionamento sul server
Su un server il percorso è <world>/datapacks/, where <world> is the value of level-name in server.properties — not the server root. Dropping the pack in the server folder is the single most common server-side mistake.
Assembla un pacchetto con i nomi delle cartelle attuali, un valido pack.mcmeta and a load tag already wired, then download it ready to drop in, with the Datapack Studio.