Last active
November 4, 2017 15:08
-
-
Save williewillus/b9cce53cb68d576dc780 to your computer and use it in GitHub Desktop.
loot table grammar
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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