Class CopyBlockState
java.lang.Object
net.minecraft.world.level.storage.loot.functions.LootItemConditionalFunction
net.minecraft.world.level.storage.loot.functions.CopyBlockState
- All Implemented Interfaces:
BiFunction<ItemStack,,LootContext, ItemStack> LootItemFunction,LootContextUser
LootItemFunction that copies a set of block state properties to the
"BlockStateTag" NBT tag of the ItemStack.
This tag is checked when the block is placed.-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class net.minecraft.world.level.storage.loot.functions.LootItemConditionalFunction
LootItemConditionalFunction.DummyBuilder -
Field Summary
FieldsFields inherited from class net.minecraft.world.level.storage.loot.functions.LootItemConditionalFunction
predicates -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateCopyBlockState(List<LootItemCondition> pConditions, Holder<Block> pBlock, List<String> pProperties) (package private)CopyBlockState(List<LootItemCondition> pConditions, Holder<Block> pBlock, Set<Property<?>> pProperties) -
Method Summary
Modifier and TypeMethodDescriptionstatic CopyBlockState.BuilderSet<ContextKey<?>> getType()protected ItemStackrun(ItemStack pStack, LootContext pContext) 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
-
CODEC
-
block
-
properties
-
-
Constructor Details
-
CopyBlockState
-
CopyBlockState
-
-
Method Details
-
getType
- Specified by:
getTypein interfaceLootItemFunction- Specified by:
getTypein classLootItemConditionalFunction
-
getReferencedContextParams
-
run
Description copied from class:LootItemConditionalFunctionCalled to perform the actual action of this function, after conditions have been checked.- Specified by:
runin classLootItemConditionalFunction
-
copyState
-