Class LootFunctionUtils
java.lang.Object
johnsmith.enchantingoverhauled.loot.function.LootFunctionUtils
Shared utility operations for the custom enchanting loot functions.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic List<net.minecraft.core.Holder<net.minecraft.world.item.enchantment.Enchantment>> getCandidates(net.minecraft.world.level.storage.loot.LootContext context, Optional<net.minecraft.core.HolderSet<net.minecraft.world.item.enchantment.Enchantment>> options, boolean allowTreasure) Resolves the list of valid candidate enchantments based on explicit options or vanilla random tags.
-
Constructor Details
-
LootFunctionUtils
public LootFunctionUtils()
-
-
Method Details
-
getCandidates
public static List<net.minecraft.core.Holder<net.minecraft.world.item.enchantment.Enchantment>> getCandidates(net.minecraft.world.level.storage.loot.LootContext context, Optional<net.minecraft.core.HolderSet<net.minecraft.world.item.enchantment.Enchantment>> options, boolean allowTreasure) Resolves the list of valid candidate enchantments based on explicit options or vanilla random tags.- Parameters:
context- The loot generation context.options- An optional predefined list of allowed enchantments.allowTreasure- Whether to allow enchantments tagged with 'TREASURE'.- Returns:
- A list of valid enchantment holders.
-