agentleFS
LiremantLiremant/minecraft-datapack-skill/minecraft-datapack/SKILL.md

minecraft-datapack

Skill0 starsChanged 47 days agoMITView on GitHub

Write, debug, review, and modernize Minecraft Java Edition data packs — mcfunction commands, /execute chains, scoreboards, markers, display entities, NBT/SNBT, predicates, advancements, tags, loot tables, item components, worldgen, and pack.mcmeta formats. Use this skill whenever the user mentions data packs, datapacks, mcfunction, /execute, scoreboard objectives, sidebar/HUD, display entities, text_display, item_display, block_display, marker entities, NBT, SNBT, command storage, predicates, advancements, function tags, pack_format, or asks to build any map-making system, minigame, custom UI, hologram, or custom mechanic in Minecraft, even if they do not say "data pack" explicitly. Also use for pack format upgrade questions, for "why does my datapack not work", and for Russian-language requests about датапаки, маркеры, дисплеи, скоардборд/сайдбар, голограммы, кастомные предметы и механики.

3 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions3 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 3

    1. Jahrome907/minecraft-agent-skills★ 217same name
    2. AIKUSAN/minecraft-agent-skills-bundle★ 4same name
    3. sinsine/minecraft-datapack★ 0same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

The file

We split this skill into the rules it gives an agent

9 rules. 0 are common, 6 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 3 edited versions we read keep these.

  • 6

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Ask, or read it from the project: pack.mcmeta format fields, version.json, gradle.properties, a README, or an existing min_format.

    line 18
  2. Distinctive:

    If the user's version is unknown and they cannot say, write for the version their existing files already target, state that assumption in …

    line 37
  3. Very specific:

    Read references/pack-structure.md for the full format table, overlays, filters, and zip rules.

    line 98
  4. Distinctive:

    Never invent a command, subcommand, field, or component: If it is not in the references or a page you fetched, it does not exist.

    line 122
  5. Very specific:

    Clean up what you spawn: Every summon in a tick loop without an existence guard creates duplicates.

    line 149
  6. Distinctive:

    Run the bundled checker on the pack root:

    line 155
  7. Distinctive:

    Every file's full contents (no "..." placeholders in commands or JSON).

    line 199
  8. Distinctive:

    Treat the user's stated symptom as a hypothesis.

    line 210
  9. Distinctive:

    Read only what the task needs.

    line 217

“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Minecraft Data Pack Engineering

Data packs are a versioned data format, not a stable API. Most wrong answers here come from one of three places: code written for an older pack format, a field name guessed instead of looked up, or a mechanism chosen that cannot do the job (scoreboard polling where an advancement trigger belongs, a display entity where a marker belongs, a marker where a real entity belongs).

Work in this order: pin the version, pick the mechanism, write the files, validate.

Step 1 — pin the target version before writing anything

Ask, or read it from the project: pack.mcmeta format fields, version.json, gradle.properties, a README, or an existing min_format. If the user gives a version like "1.21.4" or "26.2", use it exactly; never silently target latest.

Then read references/versioning.md for the format number and the breaking changes that apply. The features below are the ones that most often produce code that "looks right" but fails on the user's version:

FeatureChanged atConsequence
Singular data folders (function, not functions)1.21 / format 48Files load as nothing if plural
Item components replace item NBT1.20.5 / 41{display:{Name:...}} is dead
Text components are SNBT in commands, JSON in files1.21.5 / 71a component wrapped in a quoted string renders literally; a bare {"text":"x"} still parses
pack.mcmeta uses min_format/max_format1.21.9 / 88pack_format alone is legacy
Gamerules are namespaced snake_case1.21.11 / 94.1doDaylightCycle → minecraft:advance_time
/time is per-dimension, world clocks exist26.1 / 101.1/time set needs of <dimension> off-overworld
Block state NBT fields renamed26.3 / 121Name/Properties → id/properties
Predicate condition renamed to type26.3 / 121Old predicate files reject

If the user's version is unknown and they cannot say, write for the version their existing files already target, state that assumption in the answer, and keep version-sensitive constructs isolated so they are easy to change.

Step 2 — pick the mechanism, not just the command

GoalUseDo not use
Repeated logic.mcfunction + #minecraft:tickcommand blocks
Per-player statescoreboard objective, dummy criterionNBT on players
World/global statedata on a marker, or storagea physical block
Position anchor with no visualsmarker entityarmor stand
Floating text / HUD / hologramtext_displaynamed armor stand + CustomNameVisible
Beams, auras, rings, custom visualsparticle with count=0 points and velocitiesbig count bursts for static art
Animating particle artrotate the anchor (tp @s ~ ~ ~ ~N ~)recomputing positions in commands
Rendered block or itemblock_display / item_displayfalling block / item entity
Event detection (mine, craft, kill, travel)advancement trigger with a reward functionper-tick scoreboard polling
Right-click with a custom itemCOAS/WFOAS + minecraft.used statistic objectiveitem_used_on_block (never fires for inert items)
Hold-to-charge or consumableconsumable component + using_item / consume_item triggertick polling of the use key
Clickable spot in the worldinteraction entity + player_interacted_with_entityinvisible armor stand
Condition shared by many commandspredicate file + /execute if predicatecopy-pasted if chains
Cooldownscoreboard counting down in tickschedule per player
One-shot delay/schedule functiontick counter
Custom item identityminecraft:custom_data componentdisplay name matching
Player-facing UI panelsidebar objective + numberformat/teamstitle spam
Overworld looks differentoverride dimension/overworld biome_source, or individual density_function/overworld/*replacing the whole noise_settings
Compat with other worldgen packstags in their namespace + fabric:/neoforge: load conditionshard-coding assumptions about load order

Explain the choice in one line when it is non-obvious. Map makers inherit whatever structure you leave behind.

Step 3 — write the pack

Layout (1.21+):

pack.mcmeta
pack.png
data/minecraft/tags/function/{load,tick}.json   <- namespace is literally "minecraft"
data/<namespace>/
  function/**.mcfunction
  tags/function/**.json          # your own function tags, referenced as #<namespace>:x
  advancement/**.json
  predicate/**.json
  item_modifier/**.json
  loot_table/**.json
  recipe/**.json
  structure/**.nbt
  tags/<registry>/**.json
  worldgen/**.json
  dimension/**.json
  dimension_type/**.json

pack.mcmeta for 1.21.9+:

{"pack":{"description":"My Pack","min_format":[88,0],"max_format":[88,0]}}

For 1.20.2–1.21.8 use "pack_format": N plus optional "supported_formats":[a,b]. Read references/pack-structure.md for the full format table, overlays, filters, and zip rules.

Mandatory bootstrap — without these two files nothing runs. Both live in the minecraft namespace, not yours:

data/minecraft/tags/function/load.json

{"values":["<ns>:init"]}

data/minecraft/tags/function/tick.json

{"values":["<ns>:tick"]}

A file at data/<ns>/tags/function/load.json defines #<ns>:load, which nothing calls automatically. That is a valid way to group functions, but it is not the bootstrap.

#minecraft:load runs before any player joins, so it cannot target @a. Create objectives, storages, and forceload there; put player-facing work in tick.

Hard rules that prevent most broken packs

Never invent a command, subcommand, field, or component. If it is not in the references or a page you fetched, it does not exist. Say so instead of guessing.

Every function file is parsed at load time. One bad line makes the whole file refuse to load; the error names the file and line. Check /reload output, not just the code.

/execute context is per-branch and does not leak. as, at, positioned, rotated, anchored, in apply only to the rest of that chain. A following line starts from the function's original context. Store what you need.

Forking is the performance budget. as @e, at @e, positioned as @e multiply branches. Nested forks multiply again (as @e[type=pig] at @e[type=cow] is pigs × cows). Narrow selectors, fork once, then call a function.

Scoreboards are the only cheap numeric store. Integers only (32-bit), no floats, no strings. Use storage for structured data and NBT, scoreboard for math and per-entity counters.

Text component score/nbt/selector resolve once. Writing {score:{name:"@s",objective:"hp"}} into a text display freezes the current value. To show live numbers, rewrite the text whenever the value changes.

Display entities are client-visible entities; markers are not. Markers cost almost nothing and are invisible; displays count toward the entity count and are culled by view_range. Use markers for logic, displays for pixels.

Clean up what you spawn. Every summon in a tick loop without an existence guard creates duplicates. Use unless entity @e[tag=...,distance=..N] or a persistent tag, and provide a stop/uninstall function.

Step 4 — validate before claiming success

Run the bundled checker on the pack root:

python3 scripts/dpcheck.py path/to/pack --mc-version 1.21.9

It verifies JSON parsing, pack.mcmeta format fields, folder names for the target format, function/tag reference resolution, SNBT bracket balance, the load/tick bootstrap path, and a set of version-mismatch patterns (legacy item NBT, JSON text components in commands, Name/Properties block states on 26.3+, camelCase gamerules on 1.21.11+, condition in predicates on 26.3+, item_used_on_block on inert items). Fix every error before answering; read every warning and either fix it or say why it is intentional.

Then walk this checklist. Each line is a defect that has actually shipped in a plausible-looking pack:

  • Both hooks are at data/minecraft/tags/function/{load,tick}.json. A load.json in your own namespace runs nothing.
  • No component is wrapped in a quoted string (custom_name='{"text":"x"}'), which 1.21.5+ renders literally. A bare {"text":"x"} is valid SNBT and fine.
  • Every #minecraft:load command works with no players online.
  • Every summon is guarded, and there is a uninstall/stop function.
  • Every advancement reward function that must fire more than once ends with advancement revoke @s only <id>.
  • Every live number in a display or numberformat fixed is rewritten when the value changes — not written once.
  • Every custom item is matched by custom_data, not by name.
  • Right-click detection uses the mechanism that actually fires for that item (references/right-click.md).
  • Sidebar rows use non-# fake holders, fit in 15 rows, and have explicit descending scores.
  • Objectives referenced by scores=/if score are created in load.
  • No per-tick entity or block NBT, and no per-tick macros.

Then state the manual check the user must do, because a static checker cannot run the game: /reload (or restart), then /function <ns>:<entry> and read the log. List the exact commands to try and what success looks like.

Answer shape

For a build request, deliver:

  1. The file tree you created.
  2. Every file's full contents (no "..." placeholders in commands or JSON).
  3. The install step (zip root must contain pack.mcmeta, not a wrapping folder).
  4. The in-game verification commands and expected chat/log output.
  5. Version assumptions and anything you deliberately did not implement.
  6. What you could not verify statically (no client here), stated as a risk rather than glossed over.

For a debugging request, do not rewrite the pack. Reproduce the failure path: which function runs, under which context, with which selector, and what the log says. Fix the root cause in the shared function rather than every call site.

Treat the user's stated symptom as a hypothesis. "tellraw is broken" is usually a missing executor or a wrong field elsewhere, not a syntax problem. Verify the claim against the file and the version rules before fixing it, and say when the real cause turns out to be different from what was reported.

References

Read only what the task needs; each file is self-contained.

FileCovers
references/pack-structure.mdpack.mcmeta, format table, folders, namespaces, overlays, load/tick, zip, experiments
references/functions.md.mcfunction syntax, macros, /return, /schedule, execution order, limits, recursion
references/execute.mdevery /execute subcommand, context semantics, forking, store, if variants
references/scoreboard.mdobjectives, criteria, operations, display slots, numberformat, teams, tags, trigger, storage format
references/markers.mdmarker semantics, state storage, idempotent spawning, spatial patterns
references/displays.mdtext_display / item_display / block_display, transformation math, interpolation, culling
references/particles.mdcount=0 semantics, drawing primitives, rotation animation, dust lifetimes, performance
references/text-components.mdSNBT components, score/nbt/selector, styling, click/hover, resolution timing
references/nbt-snbt.mdSNBT types, quoting, NBT paths, storage, /data, entity/block NBT, cost model
references/selectors.mdselector variables and arguments, sorting, nbt=, predicate=, pitfalls
references/predicates-advancements.mdpredicate types, entity predicates, advancement triggers, event detection
references/tags.mdtag files, replace/required, registry paths, vanilla tags worth overriding
references/items.mditem stack syntax, components that matter, item predicates, /give//item//loot
references/right-click.mdthe five right-click detection methods, which one is correct, and their costs
references/content-registries.mdrecipes, loot tables, item modifiers, enchantments, damage types, dialogs, clocks, variants
references/commands-misc.mdthe non-execute commands a pack actually uses, plus limits
references/worldgen.mdbiomes, dimensions, features, structures, environment attributes, multi_noise
references/worldgen-case-terralith.mdmeasured anatomy of a production worldgen pack, and which techniques to copy
references/patterns.mdcanonical idioms: init, scheduler, HUD, holograms, raycast, area triggers, cleanup
references/versioning.mdformat numbers, breaking-change digest, migration checklist

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.