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.Builder
setContents
(ContainerComponentManipulator<?> pComponent) void
validate
(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, simpleBuilder
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
-
CODEC
-
component
-
entries
-
-
Constructor Details
-
SetContainerContents
SetContainerContents(List<LootItemCondition> p_193035_, ContainerComponentManipulator<?> p_340836_, List<LootPoolEntryContainer> p_298300_)
-
-
Method Details
-
getType
- Specified by:
getType
in interfaceLootItemFunction
- Specified by:
getType
in classLootItemConditionalFunction
-
run
Called to perform the actual action of this function, after conditions have been checked.- Specified by:
run
in classLootItemConditionalFunction
-
validate
Validate that this object is used correctly according to the given ValidationContext.- Specified by:
validate
in interfaceLootContextUser
- Overrides:
validate
in classLootItemConditionalFunction
-
setContents
-