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, Validatable
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 Classes -
Field Summary
FieldsFields inherited from class LootItemConditionalFunction
predicates -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateCopyBlockState(List<LootItemCondition> predicates, Holder<Block> block, List<String> propertyNames) privateCopyBlockState(List<LootItemCondition> predicates, Holder<Block> block, Set<Property<?>> properties) -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.MapCodec<CopyBlockState> codec()static CopyBlockState.BuilderSet<ContextKey<?>> protected ItemStackrun(ItemStack itemStack, LootContext context) Called to perform the actual action of this function, after conditions have been checked.Methods inherited from class LootItemConditionalFunction
apply, commonFields, simpleBuilder, validateMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface BiFunction
andThen
-
Field Details
-
MAP_CODEC
-
block
-
properties
-
-
Constructor Details
-
CopyBlockState
-
CopyBlockState
-
-
Method Details
-
codec
- Specified by:
codecin interfaceLootItemFunction- Specified by:
codecin 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
-