Class EnchantedCountIncreaseFunction
java.lang.Object
net.minecraft.world.level.storage.loot.functions.LootItemConditionalFunction
net.minecraft.world.level.storage.loot.functions.EnchantedCountIncreaseFunction
- All Implemented Interfaces:
BiFunction<ItemStack,,LootContext, ItemStack> LootItemFunction,LootContextUser
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class net.minecraft.world.level.storage.loot.functions.LootItemConditionalFunction
LootItemConditionalFunction.DummyBuilder -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<EnchantedCountIncreaseFunction> private final Holder<Enchantment> private final intstatic final intprivate final NumberProviderFields inherited from class net.minecraft.world.level.storage.loot.functions.LootItemConditionalFunction
predicates -
Constructor Summary
ConstructorsConstructorDescriptionEnchantedCountIncreaseFunction(List<LootItemCondition> pConditions, Holder<Enchantment> pEnchantment, NumberProvider pValue, int pLimit) -
Method Summary
Modifier and TypeMethodDescriptionSet<ContextKey<?>> getType()private booleanhasLimit()lootingMultiplier(HolderLookup.Provider pRegistries, NumberProvider pCount) run(ItemStack p_345285_, LootContext p_345560_) Called to perform the actual action of this function, after conditions have been checked.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
andThen
-
Field Details
-
NO_LIMIT
public static final int NO_LIMIT- See Also:
-
CODEC
-
enchantment
-
value
-
limit
private final int limit
-
-
Constructor Details
-
EnchantedCountIncreaseFunction
EnchantedCountIncreaseFunction(List<LootItemCondition> pConditions, Holder<Enchantment> pEnchantment, NumberProvider pValue, int pLimit)
-
-
Method Details
-
getType
- Specified by:
getTypein interfaceLootItemFunction- Specified by:
getTypein classLootItemConditionalFunction
-
getReferencedContextParams
-
hasLimit
private boolean hasLimit() -
run
Description copied from class:LootItemConditionalFunctionCalled to perform the actual action of this function, after conditions have been checked.- Specified by:
runin classLootItemConditionalFunction
-
lootingMultiplier
public static EnchantedCountIncreaseFunction.Builder lootingMultiplier(HolderLookup.Provider pRegistries, NumberProvider pCount)
-