Loading...
Loading...
Create, edit, and debug vanilla Minecraft 26.x and 1.21.x datapacks, including functions, advancements, recipes, loot tables, predicates, tags, and pack metadata. Use when the deliverable is a datapack file tree without Java or loader APIs.
npx skill4agent add jahrome907/minecraft-agent-skills minecraft-datapackpack.mcmetaUse whenpack.mcmetadata/....mcfunctionDo not use whenminecraft-commands-scriptingDo not use whenminecraft-modding| Minecraft Version | Preferred |
|---|---|
| 1.21 / 1.21.1 | |
| 1.21.2 / 1.21.3 | |
| 1.21.4 | |
| 1.21.5 | |
| 1.21.6 | |
| 1.21.7 / 1.21.8 | |
| 1.21.9 / 1.21.10 | |
| 1.21.11 | |
| 26.1 | |
| 26.2 | |
| 26.3 | |
pack_formatmin_formatmax_formatpack_formatsupported_formatssupported_formatssupported_formatsmin_inclusivemax_inclusive[major, minor]min_formatmax_format.0[88, 0][major, 0]min_formatmax_format94.1pack.mcmetamy-datapack/
├── pack.mcmeta
└── data/
├── <namespace>/ ← use your pack's name (e.g., mypack)
│ ├── function/
│ │ ├── main.mcfunction
│ │ └── tick.mcfunction
│ ├── advancement/
│ │ └── custom_advancement.json
│ ├── recipe/
│ │ └── custom_recipe.json
│ ├── loot_table/
│ │ └── custom_loot.json
│ ├── predicate/
│ │ └── is_night.json
│ ├── item_modifier/
│ │ └── add_name.json
│ └── tags/
│ ├── block/
│ │ └── climbable.json
│ ├── entity_type/
│ │ └── bosses.json
│ └── function/
│ └── custom_flow.json ← manually invoked tag
└── minecraft/
└── tags/function/
├── load.json ← engine tag; runs on /reload
└── tick.json ← engine tag; runs every game tickpack.mcmeta{
"pack": {
"pack_format": 81,
"description": "My Custom Datapack v1.0"
}
}{
"pack": {
"pack_format": 81,
"supported_formats": [81, 88],
"min_format": [81],
"max_format": [88],
"description": "My compatible datapack"
}
}{
"pack": {
"min_format": [88, 0],
"max_format": [88, 0],
"description": "My Custom Datapack v1.0"
}
}{
"pack": {
"min_format": [94, 1],
"max_format": [94, 1],
"description": "My Custom Datapack v1.0"
}
}{
"pack": {
"min_format": [121, 0],
"max_format": [121, 0],
"description": "My Custom Datapack v1.0"
}
}minecraft:loadminecraft:tickminecraftload.jsontick.jsondata/minecraft/tags/function/load.json{
"values": [
"<namespace>:setup"
]
}data/minecraft/tags/function/tick.json{
"values": [
"<namespace>:tick"
]
}data/<namespace>/function/setup.mcfunction# Runs once on /reload
scoreboard objectives add deaths deathCount
scoreboard objectives add kills playerKillCount
tellraw @a {"text":"[MyPack] Loaded!","color":"green"}data/<namespace>/function/tick.mcfunction# Runs every tick — KEEP THIS SHORT
# Only put fast, targeted operations here
execute as @a[scores={deaths=1..}] run function mypack:on_death_check# Chained execute — common datapack pattern for conditional per-player logic
execute as @a[gamemode=!spectator] at @s if block ~ ~-1 ~ #minecraft:logs run give @s minecraft:apple
# store result into score (bridge between NBT world and scoreboard state)
execute store result score @s mypack.health run data get entity @s Health
# in: run logic in another dimension
execute in minecraft:the_nether run say This runs in the Nether# Storage is the datapack-native key-value store — persists across /reload
data modify storage mypack:data config.difficulty set value "hard"
data get storage mypack:data config.difficulty
# Copy live entity data into storage for macro use or cross-function state
data modify storage mypack:log last_player_pos set from entity @s Posminecraft-commands-scriptingdata/mypack/function/greet.mcfunction# Macro argument: $(name)
$tellraw @a {"text":"Welcome $(name)!","color":"gold"}
$scoreboard players set $(name) points 0run functionwith# Pass values from storage
data modify storage mypack:tmp input set value {name:"Steve"}
function mypack:greet with storage mypack:tmp input
data/minecraft/worldgen/noise_settings/overworld.jsonjar xf minecraft.jar data/minecraft:gameplay/natural_mob_spawnsspawn_costs{
"spawn_costs": {
"minecraft:zombie": {
"energy_budget": 0.12,
"charge": 0.7
}
}
}datapacks/pack.mcmeta/datapack list
/datapack enable "file/my-datapack"
/datapack disable "file/my-datapack"
/reload.mcfunction.json./scripts/validate-datapack.sh --root /path/to/datapack/reload/minecraft:reload/function mypack:setuplatest.log| Error | Cause | Fix |
|---|---|---|
| Syntax error in function | Check whitespace, selector, trailing space |
| Invalid JSON in any file | Validate with |
| Wrong | Update |
| Function not running on tick | Missing engine tick tag or wrong namespace | Check |
| Macro error | | Provide |
# Run from the installed skill directory (for example `.codex/skills/minecraft-datapack`):
./scripts/validate-datapack.sh --root /path/to/datapack
# Strict mode treats warnings as failures:
./scripts/validate-datapack.sh --root /path/to/datapack --strictpack.mcmetadata/**/*.jsondata/minecraft/tags/function/load.jsontick.json.mcfunctionload.jsontick.json