Class LootFunctionUtils

java.lang.Object
johnsmith.enchantingoverhauled.loot.function.LootFunctionUtils

public class LootFunctionUtils extends Object
Shared utility operations for the custom enchanting loot functions.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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.