Wiki
Clone wikiLoot Overhaul / Loot Functions - Enchantments
Loot Functions - Enchantments
Structure:
Property | Type | Description |
---|---|---|
enchantment | Enchantment Object or Enchantment Object List | List of potential enchantments to generate. |
enchantment -> {} -> name | String | The name of the enchantment, like minecraft:silk_touch . |
enchantment -> {} -> level | Integer | The level of the enchantment. (Optional, defaults to 1) |
number_to_generate | Integer or Integer Range | How many enchantments from the list to generate (Optional, defaults to 1) |
replace | String | Optional string to replace in the nbt instead of generating a new tag. (Optional) |
Description:
Adds enchantments to the item. More of a convenience, since modded enchantment ids change between worlds, and enchantments on items still use numerical ids for some reason.
Example Usage:
Adds silk touch
"functions": [ { "function": "lootoverhaul:enchantments", "enchantment": { "name": "minecraft:silk_touch" } } ]
"functions": [ { "function": "lootoverhaul:enchantments", "enchantment": [ { "name": "minecraft:sharpness", "level": { "min": 1, "max": 3 } }, { "name": "minecraft:smite", "level": { "min": 1, "max": 3 } }, { "name": "minecraft:bane_of_arthropods", "level": { "min": 1, "max": 3 } } ], "number_to_generate": 2 } ]
"functions": [ { "function": "set_nbt", "tag": "{StoredEnchantments:\"#GeneratedEnchantments\"}" }, { "function": "lootoverhaul:enchantments", "enchantment": [ { "name": "minecraft:silk_touch" }, { "name": "minecraft:mending" }, { "name": "minecraft:efficiency", "level": { "min": 1, "max": 5 } } ], "replace": "\"#GeneratedEnchantments\"" } ]
Previous - Custom Potion Effects | Back | Next - Function Group |
Updated