Class SetStewEffectFunction
java.lang.Object
net.minecraft.world.level.storage.loot.functions.LootItemConditionalFunction
net.minecraft.world.level.storage.loot.functions.SetStewEffectFunction
- All Implemented Interfaces:
BiFunction<ItemStack, LootContext, ItemStack>, LootItemFunction, LootContextUser, Validatable
LootItemFunction that adds an effect to any suspicious stew items. A random effect is chosen from the given map every time.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classprivate static final record -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List<SetStewEffectFunction.EffectEntry> private static final com.mojang.serialization.Codec<List<SetStewEffectFunction.EffectEntry>> static final com.mojang.serialization.MapCodec<SetStewEffectFunction> Fields inherited from class LootItemConditionalFunction
predicates -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateSetStewEffectFunction(List<LootItemCondition> predicates, List<SetStewEffectFunction.EffectEntry> effects) -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.MapCodec<SetStewEffectFunction> codec()run(ItemStack itemStack, LootContext context) Called to perform the actual action of this function, after conditions have been checked.voidvalidate(ValidationContext context) Validate that this object is used correctly according to the given ValidationContext.Methods inherited from class LootItemConditionalFunction
apply, commonFields, simpleBuilderMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface BiFunction
andThenMethods inherited from interface LootContextUser
getReferencedContextParams
-
Field Details
-
EFFECTS_LIST
private static final com.mojang.serialization.Codec<List<SetStewEffectFunction.EffectEntry>> EFFECTS_LIST -
MAP_CODEC
-
effects
-
-
Constructor Details
-
SetStewEffectFunction
private SetStewEffectFunction(List<LootItemCondition> predicates, List<SetStewEffectFunction.EffectEntry> effects)
-
-
Method Details
-
codec
- Specified by:
codecin interfaceLootItemFunction- Specified by:
codecin classLootItemConditionalFunction
-
validate
Description copied from interface:LootContextUserValidate that this object is used correctly according to the given ValidationContext.- Specified by:
validatein interfaceLootContextUser- Specified by:
validatein interfaceValidatable- Overrides:
validatein classLootItemConditionalFunction
-
run
Description copied from class:LootItemConditionalFunctionCalled to perform the actual action of this function, after conditions have been checked.- Specified by:
runin classLootItemConditionalFunction
-
stewEffect
-