JSON Files
MC-Build includes placeholder syntaxe for raw JSON Files.
Looking for Tags?
Tags have their own custom syntax in MC-Build.
Check out This Page if you're looking for how to define function, block, entity, or other tags.
Head's Up!
JSON File syntax may change in the near future to provide more generative features.
Supported JSON Files
Advancements
advancement <name> <json>
Enchantments
enchantment <name> <json>
Item Modifiers
item_modifier <name> <json>
Loot Tables
loot_table <name> <json>
Predicates
predicate <name> <json>
Recipes
recipe <name> <json>
Chat Type
chat_type <name> <json>
Damage Type
damage_type <name> <json>
Dimension
dimension <name> <json>
Dimension Type
dimension_type <name> <json>
Other Data Pack Registries
These keywords write to the data pack folder of the same name, data/<namespace>/<keyword>/<name>.json.
<keyword> <name> <json>
banner_pattern |
block_transformer |
cat_variant |
chicken_variant |
context_float_provider |
context_int_provider |
cow_variant |
decorated_pot_pattern |
dialog |
enchantment_provider |
frog_variant |
instrument |
jukebox_song |
painting_variant |
pig_variant |
slot_source |
sulfur_cube_archetype |
test_environment |
test_instance |
timeline |
trade_set |
trial_spawner |
trim_material |
trim_pattern |
villager_trade |
wolf_sound_variant |
wolf_variant |
world_clock |
zombie_nautilus_variant |
Any Other JSON File
Use json with a folder name to write a JSON file that has no keyword, such as one for a registry added after your version of MC-Build.
json <folder> <name> <json>
Examples
Generic JSON File
json some_new_registry my_file {
"value": 1
}
{"value": 1}
Worldgen
worldgen <type> <name> <json>
worldgen biome <name> <json>
worldgen configured_carver <name> <json>
worldgen configured_feature <name> <json>
worldgen density_function <name> <json>
worldgen noise <name> <json>
worldgen noise_settings <name> <json>
worldgen placed_feature <name> <json>
worldgen processor_list <name> <json>
worldgen structure <name> <json>
worldgen structure_set <name> <json>
worldgen template_pool <name> <json>
worldgen world_preset <name> <json>
worldgen flat_level_generator_preset <name> <json>
Writing the JSON
The JSON goes in a block after the name. It can span several lines, with nested objects and arrays:
advancement my_advancement {
"criteria": {
...
},
"rewards": {
...
}
}
A short file can fit on one line:
damage_type my_damage { "message_id": "generic", "scaling": "never", "exhaustion": 0 }
You can use inline JavaScript in both the name and the JSON:
damage_type hit_<%id%> { "exhaustion": <%id / 10%>, "message_id": "generic", "scaling": "never" }