Class SetContainerContents
java.lang.Object
net.minecraft.world.level.storage.loot.functions.LootItemConditionalFunction
net.minecraft.world.level.storage.loot.functions.SetContainerContents
- All Implemented Interfaces:
BiFunction<ItemStack,,LootContext, ItemStack> LootItemFunction,LootContextUser
LootItemFunction that sets the contents of a container such as a chest by setting the
BlocKEntityTag of the stacks.
The contents are based on a list of loot pools.-
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<SetContainerContents> private final ContainerComponentManipulator<?> private final List<LootPoolEntryContainer> Fields inherited from class net.minecraft.world.level.storage.loot.functions.LootItemConditionalFunction
predicates -
Constructor Summary
ConstructorsConstructorDescriptionSetContainerContents(List<LootItemCondition> p_193035_, ContainerComponentManipulator<?> p_340836_, List<LootPoolEntryContainer> p_298300_) -
Method Summary
Modifier and TypeMethodDescriptiongetType()run(ItemStack pStack, LootContext pContext) Called to perform the actual action of this function, after conditions have been checked.static SetContainerContents.BuildersetContents(ContainerComponentManipulator<?> pComponent) voidvalidate(ValidationContext pContext) Validate that this object is used correctly according to the given ValidationContext.Methods inherited from class net.minecraft.world.level.storage.loot.functions.LootItemConditionalFunction
apply, commonFields, simpleBuilderMethods 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
-
component
-
entries
-
-
Constructor Details
-
SetContainerContents
SetContainerContents(List<LootItemCondition> p_193035_, ContainerComponentManipulator<?> p_340836_, List<LootPoolEntryContainer> p_298300_)
-
-
Method Details
-
getType
- Specified by:
getTypein interfaceLootItemFunction- Specified by:
getTypein classLootItemConditionalFunction
-
run
Called to perform the actual action of this function, after conditions have been checked.- Specified by:
runin classLootItemConditionalFunction
-
validate
Validate that this object is used correctly according to the given ValidationContext.- Specified by:
validatein interfaceLootContextUser- Overrides:
validatein classLootItemConditionalFunction
-
setContents
-