Loot Functions Function Group - Tmtravlr/LootOverhaul GitHub Wiki

Loot Functions - Function Group

Structure:

Property Type Description
functions Function List List of other functions to apply.
number_to_apply Integer or Integer Range How many functions from the list to apply (Optional, defaults to all)

Description:

Runs a group of functions, useful with conditions like random chance (so all are chosen together). If you give it a number or range called number_to_apply, it will randomly choose that many functions to apply from the list (otherwise it will apply all).

Example Usage:

Runs two functions

"functions": [
 	{
 		"function": "lootoverhaul:function_group",
 		"functions": [
			{
 				"function": "minecraft:furnace_smelt"
			},
			{
				"function": "minecraft:set_count",
				"count": 10
			}
 		]
 	}
]

Will choose one or two functions to run

"functions": [
 	{
 		"function": "lootoverhaul:function_group",
 	 	"number_to_apply": {
 	 	 	"min": 1,
 	 	 	"max": 2
 	 	},
 		"functions": [
 			{
 				"function": "minecraft:set_nbt",
				"tag": "{display:{Name:\"Really Awesome Weapon\"}}"
 			},
 			{
 				"function": "minecraft:enchant_randomly"
 			},
 			{
 				"function": "minecraft:set_damage",
				"damage": 0.3
 			}
		]
	}
]
Previous - Enchantments Back Next - Replace NBT
⚠️ **GitHub.com Fallback** ⚠️