Class EnchantRandomlyFunction

java.lang.Object
net.minecraft.world.level.storage.loot.functions.LootItemConditionalFunction
johnsmith.enchantingoverhauled.loot.function.EnchantRandomlyFunction
All Implemented Interfaces:
BiFunction<net.minecraft.world.item.ItemStack,net.minecraft.world.level.storage.loot.LootContext,net.minecraft.world.item.ItemStack>, net.minecraft.world.level.storage.loot.functions.LootItemFunction, net.minecraft.world.level.storage.loot.LootContextUser

public class EnchantRandomlyFunction extends net.minecraft.world.level.storage.loot.functions.LootItemConditionalFunction
A "Super" dispatcher loot function that evaluates recipes and delegates item enchantments to specific strategy functions based on the item's tags and attachment type.
  • Nested Class Summary

    Nested classes/interfaces inherited from class net.minecraft.world.level.storage.loot.functions.LootItemConditionalFunction

    net.minecraft.world.level.storage.loot.functions.LootItemConditionalFunction.Builder<T extends net.minecraft.world.level.storage.loot.functions.LootItemConditionalFunction.Builder<T>>
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final com.mojang.serialization.MapCodec<EnchantRandomlyFunction>
     

    Fields inherited from class net.minecraft.world.level.storage.loot.functions.LootItemConditionalFunction

    predicates
  • Constructor Summary

    Constructors
    Constructor
    Description
    EnchantRandomlyFunction(List<net.minecraft.world.level.storage.loot.predicates.LootItemCondition> conditions, Optional<net.minecraft.core.HolderSet<net.minecraft.world.item.enchantment.Enchantment>> options, boolean treasure)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    net.minecraft.world.level.storage.loot.functions.LootItemFunctionType<EnchantRandomlyFunction>
     
    net.minecraft.world.item.ItemStack
    run(net.minecraft.world.item.ItemStack stack, net.minecraft.world.level.storage.loot.LootContext context)
     

    Methods inherited from class net.minecraft.world.level.storage.loot.functions.LootItemConditionalFunction

    apply, commonFields, simpleBuilder, validate

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface java.util.function.BiFunction

    andThen

    Methods inherited from interface net.minecraft.world.level.storage.loot.LootContextUser

    getReferencedContextParams
  • Field Details

  • Constructor Details

    • EnchantRandomlyFunction

      public EnchantRandomlyFunction(List<net.minecraft.world.level.storage.loot.predicates.LootItemCondition> conditions, Optional<net.minecraft.core.HolderSet<net.minecraft.world.item.enchantment.Enchantment>> options, boolean treasure)
  • Method Details

    • run

      public net.minecraft.world.item.ItemStack run(net.minecraft.world.item.ItemStack stack, net.minecraft.world.level.storage.loot.LootContext context)
      Specified by:
      run in class net.minecraft.world.level.storage.loot.functions.LootItemConditionalFunction
    • getType

      public net.minecraft.world.level.storage.loot.functions.LootItemFunctionType<EnchantRandomlyFunction> getType()
      Specified by:
      getType in interface net.minecraft.world.level.storage.loot.functions.LootItemFunction
      Specified by:
      getType in class net.minecraft.world.level.storage.loot.functions.LootItemConditionalFunction