Several behavior tables live in code as hardcoded key:value maps (compost chances in ComposterBlock are one visible example). No tag, component or file can extend them.
Which leads to:
- Packs reimplement maps by hand in mcfunction: storage dictionaries, scoreboard lookups, macro dispatch chains, tags as boolean keys. Slow, fragile, doesn't compose across packs.
- Some needs are unfixable by nature: tables consumed by game logic itself can't be emulated from functions. Nothing makes a composter accept another item or changes a compost chance, because the block reads the internal map directly. Workarounds stop where vanilla code begins.
Solution:
A datapack data type alongside tags: key-value maps ('constant tables'), one file per map, e.g. `data/*/constants/compostable.json`, with tag merge semantics authors already know: additive across packs, optional "replace": true, includes of other maps:
{ "values":[{"key":"minecraft:oak_leaves","value":0.3},{"key":"myns:dried_leaves","value":0.4},"$myns:leaf_litter"]}
duplicate keys: last write wins by pack priority; optional per-entry remove; range warnings.
First consumer candidate: minecraft:compostable; mechanism generic.
Benefits:
- Declarative data replaces function-side hacks: faster, inspectable, composable; single-key overrides instead of forked lists.
- Unfixable-by-nature cases become fixable: game logic reads the map, so vanilla behaviors accept data-driven entries.
- Future: other hardcoded tables migrate; maps queryable as a constants store.
0 Comments
Please sign in to leave a comment.
Post a new comment: