Class EnchantSourceFunction
java.lang.Object
net.minecraft.world.level.storage.loot.functions.LootItemConditionalFunction
johnsmith.enchantingoverhauled.loot.function.EnchantSourceFunction
- 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 EnchantSourceFunction
extends net.minecraft.world.level.storage.loot.functions.LootItemConditionalFunction
Enchants untagged standard catalysts (like Enchanted Books).
Exclusively writes to the STORED_ENCHANTMENTS component and enforces global limits.
-
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
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<EnchantSourceFunction> Fields inherited from class net.minecraft.world.level.storage.loot.functions.LootItemConditionalFunction
predicates -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedEnchantSourceFunction(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 TypeMethodDescriptionnet.minecraft.world.level.storage.loot.functions.LootItemFunctionType<EnchantSourceFunction> getType()static net.minecraft.world.item.ItemStackprocess(net.minecraft.world.item.ItemStack stack, net.minecraft.world.level.storage.loot.LootContext context, Optional<net.minecraft.core.HolderSet<net.minecraft.world.item.enchantment.Enchantment>> options, boolean allowTreasure) net.minecraft.world.item.ItemStackrun(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, validateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.function.BiFunction
andThenMethods inherited from interface net.minecraft.world.level.storage.loot.LootContextUser
getReferencedContextParams
-
Field Details
-
CODEC
-
-
Constructor Details
-
EnchantSourceFunction
-
-
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:
runin classnet.minecraft.world.level.storage.loot.functions.LootItemConditionalFunction
-
process
public static net.minecraft.world.item.ItemStack process(net.minecraft.world.item.ItemStack stack, net.minecraft.world.level.storage.loot.LootContext context, Optional<net.minecraft.core.HolderSet<net.minecraft.world.item.enchantment.Enchantment>> options, boolean allowTreasure) -
getType
public net.minecraft.world.level.storage.loot.functions.LootItemFunctionType<EnchantSourceFunction> getType()- Specified by:
getTypein interfacenet.minecraft.world.level.storage.loot.functions.LootItemFunction- Specified by:
getTypein classnet.minecraft.world.level.storage.loot.functions.LootItemConditionalFunction
-