minecraft-datapack

创建、编辑与调试原版 Minecraft 26.x 与 1.21.x 的数据包内容:函数、进度、配方、战利品表、谓词、标签与包元数据。适用于产出为不含 Java 或加载器 API 的数据包文件树的情况。

仓库最近推送
GitHub Stars
218
Forks
12
Issues / PRs
0

安装方式

先用 Prompt 核对来源与依赖。也可下载安装包。

用 AI 助手安装

复制提示词,让助手先核对固定版本和依赖。

查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "minecraft-datapack":https://skillpi.com/zh/skills/deepskill-fd74831a2d54c719df5fbd3d44094a3c3681a9a848ec990e8bce72f240a3e61e。安装前核对上游来源和版本:https://github.com/Jahrome907/minecraft-agent-skills。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。

来源与配置

github.com

配置方式待核实

请查看原始来源中的适用工具、依赖和权限要求。

安装实测待补充

创建、编辑与调试原版 Minecraft 26.x 与 1.21.x 的数据包内容:函数、进度、配方、战利品表、谓词、标签与包元数据。适用于产出为不含 Java 或加载器 API 的数据包文件树的情况。

0 下载

介绍来源: third_party · Jahrome907 · 0.0.1 参考来源

SkillPi 解读

能完成的任务
翻译待完成,请参阅来源文档。
软件、账号及付费要求
翻译待完成,请参阅来源文档。
实测状态
未测试

文件浏览

在原站浏览文件 ↗

原始 SKILL.md

打开原文 ↗
Frontmatter
name: minecraft-datapack
description: "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."

Minecraft Datapack Skill

Inspect pack.mcmeta and the target Minecraft version before editing. Preserve an existing target unless migration is requested; metadata numbers alone do not make older command or registry schemas compatible. Check the edited files with the bundled validator and test in-game when available.

Skill Scope

Routing Boundaries

  • Use when: the deliverable is datapack files (pack.mcmeta, data/...) and .mcfunction/JSON content.
  • Do not use when: the request is command-only snippets not tied to a datapack file tree (minecraft-commands-scripting).
  • Do not use when: the request requires loader APIs, Java code, or runtime mod behavior (minecraft-modding).

Pack Metadata

Minecraft Version Preferred pack metadata
1.21 / 1.21.1 pack_format: 48
1.21.2 / 1.21.3 pack_format: 57
1.21.4 pack_format: 61
1.21.5 pack_format: 71
1.21.6 pack_format: 80
1.21.7 / 1.21.8 pack_format: 81
1.21.9 / 1.21.10 min_format: [88, 0], max_format: [88, 0]
1.21.11 min_format: [94, 1], max_format: [94, 1]
26.1 min_format: [101, 1], max_format: [101, 1]
26.2 min_format: [107, 1], max_format: [107, 1]
26.3 min_format: [121, 0], max_format: [121, 0]

Use pack_format for a legacy-only target through data pack format 81. Starting with data pack format 82 in 1.21.9, define both explicit min_format and max_format values. A range that includes a legacy format below 82 must also retain pack_format and supported_formats; do not include supported_formats for a modern-only range. For a legacy-compatible range, supported_formats may be one integer, a two-integer inclusive range, or an object with integer min_inclusive and max_inclusive fields. For exact patch targeting, use [major, minor] arrays for both min_format and max_format, including .0 versions such as [88, 0]. A single integer is equivalent to [major, 0] for min_format, while a single integer in max_format allows any minor version on that major line. Do not write decimal JSON numbers such as 94.1.

Keep pack.mcmeta exact for the patch you target instead of trying to span the multiple Minecraft releases with one metadata block.


Directory Layout

my-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 tick

pack.mcmeta

1.21.8 and earlier

{
  "pack": {
    "pack_format": 81,
    "description": "My Custom Datapack v1.0"
  }
}

Deliberate legacy-to-modern compatibility range

Use this form only when the pack actually supports both sides of the format-82 boundary. Mojang requires the retained legacy fields for this range.

{
  "pack": {
    "pack_format": 81,
    "supported_formats": [81, 88],
    "min_format": [81],
    "max_format": [88],
    "description": "My compatible datapack"
  }
}

1.21.9 / 1.21.10

{
  "pack": {
    "min_format": [88, 0],
    "max_format": [88, 0],
    "description": "My Custom Datapack v1.0"
  }
}

1.21.11

{
  "pack": {
    "min_format": [94, 1],
    "max_format": [94, 1],
    "description": "My Custom Datapack v1.0"
  }
}

26.3

{
  "pack": {
    "min_format": [121, 0],
    "max_format": [121, 0],
    "description": "My Custom Datapack v1.0"
  }
}

Function Tags (load / tick)

The engine recognizes the minecraft:load and minecraft:tick tags, so these files must use the minecraft namespace. A load.json or tick.json in a custom namespace is a valid custom tag name, but it has no automatic behavior.

data/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

Commands and Function Syntax

Execute subcommands (datapack-specific patterns)

# 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 NBT (datapack-specific global state)

# 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 Pos

For full command syntax, selectors, and scoreboard operations see the Minecraft Wiki — Commands reference. The minecraft-commands-scripting skill covers command-only work in depth.


Macros (1.20.2+)

Macro functions let you pass dynamic arguments to a function.

Define a macro function (data/mypack/function/greet.mcfunction)

# Macro argument: $(name)
$tellraw @a {"text":"Welcome $(name)!","color":"gold"}
$scoreboard players set $(name) points 0

Call with run function + with

# Pass values from storage
data modify storage mypack:tmp input set value {name:"Steve"}
function mypack:greet with storage mypack:tmp input

Registry data examples

Read references/data-examples.md when authoring advancements, recipes, loot tables, predicates, or tags. Load only the relevant section and keep existing namespaces and version targets.

Worldgen Overrides

Override biome noise (data/minecraft/worldgen/noise_settings/overworld.json)

Edit inside an existing copy — do NOT create from scratch without the full JSON. Get the vanilla version from the Minecraft jar: jar xf minecraft.jar data/.

Override a biome's spawn costs (through 26.2)

For 26.3, use the biome's minecraft:gameplay/natural_mob_spawns environment attribute instead; the old top-level spawn_costs field was removed.

{
  "spawn_costs": {
    "minecraft:zombie": {
      "energy_budget": 0.12,
      "charge": 0.7
    }
  }
}

Installation & Testing

Place the pack folder or ZIP under the world's datapacks/ directory, with pack.mcmeta at its root. Then use these in-game commands:

/datapack list
/datapack enable "file/my-datapack"
/datapack disable "file/my-datapack"
/reload

Development workflow

  1. Edit .mcfunction or .json files
  2. Run the bundled validator to catch JSON and path errors before loading:
    ./scripts/validate-datapack.sh --root /path/to/datapack
  3. If errors, fix and re-validate until clean
  4. Run /reload in-game (or /minecraft:reload if a mod intercepts it)
  5. Test with target command (e.g., /function mypack:setup, trigger an advancement)
  6. Check latest.log for runtime errors (missing references, bad selectors)

Common Errors

Error Cause Fix
Unknown or invalid command Syntax error in function Check whitespace, selector, trailing space
Datapack did not load Invalid JSON in any file Validate with jq . < file.json
pack metadata mismatch Wrong pack_format or min_format / max_format values Update pack.mcmeta for the exact Minecraft release
Function not running on tick Missing engine tick tag or wrong namespace Check data/minecraft/tags/function/tick.json
Macro error $ line but no with Provide with storage/entity/block

Validator Script

Use the bundled validator script before shipping a datapack update:

# 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 --strict

What it checks:

  • JSON validity for pack.mcmeta and data/**/*.json
  • Legacy pluralized path mistakes for loot tables, functions, and block/item/function tags
  • data/minecraft/tags/function/load.json and tick.json references resolve to local .mcfunction files
  • custom-namespace load.json and tick.json names, which are valid but do not run automatically

References

版本历史

  1. v2.5.4 GitHub ↗
    原版更新说明

    - Correct version-specific examples and source links across the skill library. - Trim obsolete snippets, preserve legacy guidance, and sync all skill copies. Validated with the repository checks and all 13 skill validators. No game runtime testing was performed.

  2. v2.5.3 GitHub ↗
    原版更新说明

    Updates the 13-skill Minecraft bundle for GPT-6 Astra and Claude Fable 5.1 workflows while preserving existing project versions and host tool boundaries. - Refreshes current Minecraft 26.x / Java 25 guidance and keeps explicit Minecraft 1.21.x / Java 21 and Forge 1.20.1 / Java 17 lanes. - Corrects pack metadata, resource references, mod and GameTest registration, Paper commands, world-generation examples, server operations, and publishing instructions. - Addresses all PR #11 review findings and strengthens regression coverage for implicit legacy GameTest templates and class-specific registration. - Synchronizes Codex, Claude Code, and plugin skill copies; package, lockfile, and both plugin manifests are version 2.5.3. Validation: full repository checks and focused positive/negative regression cases passed locally. GitHub Skills Audit and secret scanning passed on the released commit. These are content, packaging, and static-validator checks; they do not certify Java compilation or in-game behavior. Fable 5.1 guidance was checked against official documentation, without a live authenticated model evaluation. See the [September skill audit](https://github.com/Jahrome907/minecraft-agent-skills/blob/v2.5.3/docs/skill-audit-2026-09.md) for sources, coverage, and validation limits. Changes: https://github.com/Jahrome907/minecraft-agent-skills/pull/11

  3. v2.5.2 GitHub ↗
    原版更新说明

    Refreshes the skill set for current Minecraft 26.2 and Java 25 while preserving explicit Minecraft 1.21.x and Forge 1.20.1 legacy lanes. Adds current pack metadata, Paper and MockBukkit examples, 26.2 multiloader validation, corrected GameTest structure paths, refreshed self-contained YAML tooling and Markdown lint dependencies, and Node 24-compatible pinned GitHub Actions. Validated by the full repository check and secret scan.

  4. v2.5.1 GitHub ↗
    原版更新说明

    ## Added - Added a README quick-install prompt for installing the Codex or Claude Code skill bundle without manually cloning the repo. ## Changed - Corrected worldgen, resource-pack, command-script, and server-ops examples. - Hardened datapack, worldgen, Paper plugin, testing, multiloader, and workflow validation coverage. - Clarified Codex plugin install requirements and aligned CI with the full local check gate. - Pinned workflow actions to full commit SHAs. - Bumped package and plugin metadata to version 2.5.1.

  5. v2.5.0 GitHub ↗
    原版更新说明

    ### Changed - Refreshed 1.21.x version guidance for Fabric 1.21.11, Architectury multiloader artifacts, MockBukkit 4.x, and Gradle setup actions. - Corrected 1.21.9+ datapack/resource-pack metadata examples and validators to use exact `[major, minor]` pack versions instead of JSON decimals. - Added resource-pack validator coverage for 1.21.4+ `assets/<namespace>/items/*.json` item model definitions. - Updated command examples for 1.21.9 spawn rotation syntax and 1.21.11 namespaced gamerules, and made the bundled stopwatch `.mcfunction` copyable. - Hardened server-admin, WorldEdit, and EssentialsX ops guidance around Velocity forwarding, backup quiescing, WorldEdit history cleanup, sign-shop permissions, and spawn-module checks. - Added local mirror-sync validation to `npm run check` and aligned CI to use the same npm script entrypoints. - Clarified that this bundle remains centered on 1.21.x and that Minecraft 26.1.x requires a separate Java/API/data-format verification pass. - Bumped package and plugin metadata to version `2.5.0`.

此处仅展示最近 5 个版本。 在原站查看完整版本历史 ↗

当前收录版本

0.0.1

核对来源版本 ↗

安全与评测信息

质量评测

满分100 · 来自 SkillPi LAB 实验室的评测报告。

场景价值92/100

亮点

  • 专门针对Minecraft数据包创建和编辑的高价值工具
  • 提供完整的版本兼容性指南和最佳实践
  • 包含详细的错误处理和验证流程
触发精准95/100

亮点

  • 触发描述精准完整,边界清晰
  • 明确区分了适用和不适用场景
  • 提供了具体的版本号和格式要求
结构规范90/100

亮点

  • 结构清晰,包含完整的目录布局和示例
  • 提供了详细的pack.mcmeta配置示例
  • 包含完整的开发工作流程说明
执行可靠85/100

亮点

  • 提供了验证脚本和错误检查机制
  • 包含详细的常见错误和修复方案
  • 提供了完整的测试和调试流程
证据可验 (前四项均值)91/100

取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。

正文静态检测

100 / 100 · skillpi-20261123-no-r3-v1

正文未命中当前规则。

分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。

权限与使用前检查

根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。

未从主文档识别到上述常见操作,不能据此判断无需权限或没有风险。

文档引用的域名或地址

这些地址可能用于文档链接或示例,不是已批准的联网清单。使用前核对实际目的地及发送的数据。

  • minecraft.wiki
  • www.minecraft.net

本站展示提示不会授予权限。涉及文件改动、密钥、外部发送或费用时,仍由你使用的工具按需确认。

安全评级与访问范围

safe · 静态证据核验,不代表运行安全保证。

翻译待完成,请参阅来源文档。

使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。