Skip to content

Instantly share code, notes, and snippets.

@williewillus
Last active November 4, 2017 15:08
Show Gist options
  • Save williewillus/b9cce53cb68d576dc780 to your computer and use it in GitHub Desktop.
Save williewillus/b9cce53cb68d576dc780 to your computer and use it in GitHub Desktop.
loot table grammar
{
"pools": [ <lootpool> ... ] // Every pool is queried by the table the number of times specified in "rolls"
}
-------------
<lootpool> == {
"name": <autogenerated for vanilla pools | table-unique name for this pool>
"conditions": [ <lootcondition> ... ],
"rolls": <randomvaluerange>
"bonus_rolls": <randomvaluerange>
"entries": [ <lootentry> ... ]
}
<lootentry> == {
"conditions": [ <lootcondition> ... ],
"type": <"item"|"loot_table"|"empty">,
"name": <registry name of item | loot table id>,
"entryName": <autogenerated from "name" | pool-unique name for this entry>
// ^^^ if you have the same item in multiple entries in the same pool you have to specify this manually
"functions": [ <lootfunction> ... ],
"weight": <num>
"quality": <num>
}
<lootfunction> == {
"function": "<string id of function>",
"conditions": [ <lootcondition> ... ]
<any additional info needed by function>
}
functions provided by vanilla: [
"minecraft:enchant_randomly",
"minecraft:enchant_with_levels",
"minecraft:furnace_smelt",
"minecraft:looting_enchant",
"minecraft:set_attributes",
"minecraft:set_count",
"minecraft:set_damage", // For tools
"minecraft:set_data", // For other kinds of meta
"minecraft:set_nbt"
]
<lootcondition> == {
"condition": "<string id of condition>",
<any additional info needed by condition>
}
conditions provided by vanilla: [
"minecraft:entity_properties", // checks if entity has some property. currently only one exists: "on_fire"
"minecraft:entitty_scores",
"minecraft:killed_by_player",
"minecraft:random_chance",
"minecraft:random_chance_with_looting"
]
<randomvaluerange> == <num>
<randomvaluerange> == {
"min": <num>,
"max": <num>
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment