دیتاپک لود نمیشود؟ ساختار پوشه و سه نامی که باید مطابقت داشته باشند
دیتاپکی که در /datapack list ظاهر نمیشود، مشکل مسیر دارد نه مشکل کد. در اینجا ساختار درختی دقیق، قانون namespace و پوشههایی که تغییر نام دادهاند آمده است.
/datapack list shows nothing, or shows the pack as disabled. Almost always the JSON is fine and the folders are wrong.
ساختار درختی
world/datapacks/my_pack/
├── pack.mcmeta
└── data/
└── my_namespace/
├── function/ one .mcfunction per file
├── recipe/
├── loot_table/
├── advancement/
├── predicate/
└── tags/
└── function/
└── load.json
سه نام باید هماهنگ باشند و یکی از آنها چندان واضح نیست:
pack.mcmetaat the pack root — کنارdata/, not inside it.data/<namespace>/— namespace شما، با حروف کوچک، بدون فاصله. این پیشوند میشود
در my_namespace:my_function.
- نامهای پوشه دستهبندی، که تغییر کردهاند و معمولاً مقصر اصلی هستند.
پوشهها به حالت مفرد تغییر نام داده شدند
این کار باعث خراب شدن بسیاری از پکها و آموزشها شد:
| قدیمی | فعلی |
|---|---|
functions/ | function/ |
recipes/ | recipe/ |
loot_tables/ | loot_table/ |
advancements/ | advancement/ |
predicates/ | predicate/ |
structures/ | structure/ |
پکی که از نامهای جمع استفاده میکند لود میشود — در این قسمت ظاهر میشود /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.
اجرای خودکار یک مورد
دو تگ ویژه:
data/minecraft/tags/function/load.json → runs once on load/reload
data/minecraft/tags/function/tick.json → runs every tick
توجه data/minecraft/، نه namespace خودتان — تگ متعلق به Minecraft است، فانکشنهایی که به آنها اشاره میکند متعلق به شما هستند:
{ "values": ["my_namespace:setup"] }
عیبیابی به ترتیب
/datapack list— if the pack is not listed at all,pack.mcmetais missing,
دارای فرمت نادرست، یا یک سطح بیش از حد عمیق.
- در لیست آمده اما غیرفعال —
/datapack enable "file/my_pack". Note thefile/prefix
و علامتهای نقلقول.
- در لیست آمده و فعال است اما بیاثر — اشتباه در
pack_format, or plural folder names. /reloadand read the chat. Syntax errors in functions surface there, not silently.
زیپشده یا نه
هر دو کار میکنند. زیپشده یعنی pack.mcmeta at the ریشه zip، دقیقاً مانند ریسورس پکها. ساختار پوشهای هنگام توسعه آسانتر است زیرا /reload picks up edits without re-zipping.
مکان قرارگیری در سرور
در سرور مسیر عبارت است از <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.
ساخت یک پک با نامهای پوشه فعلی، یک pack.mcmeta and a load tag already wired, then download it ready to drop in, with the Datapack Studio.