Class SetBannerPatternFunction
java.lang.Object
net.minecraft.world.level.storage.loot.functions.LootItemConditionalFunction
net.minecraft.world.level.storage.loot.functions.SetBannerPatternFunction
- All Implemented Interfaces:
BiFunction<ItemStack, LootContext, ItemStack>, LootItemFunction, LootContextUser, Validatable
LootItemFunction that sets the banner patterns for a banner item. Optionally appends to any existing patterns.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final booleanstatic final com.mojang.serialization.MapCodec<SetBannerPatternFunction> private final BannerPatternLayersFields inherited from class LootItemConditionalFunction
predicates -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateSetBannerPatternFunction(List<LootItemCondition> predicates, BannerPatternLayers patterns, boolean append) -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.MapCodec<SetBannerPatternFunction> codec()protected ItemStackrun(ItemStack itemStack, LootContext context) Called to perform the actual action of this function, after conditions have been checked.setBannerPattern(boolean append) 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
andThenMethods inherited from interface LootContextUser
getReferencedContextParams
-
Field Details
-
MAP_CODEC
-
patterns
-
append
private final boolean append
-
-
Constructor Details
-
SetBannerPatternFunction
private SetBannerPatternFunction(List<LootItemCondition> predicates, BannerPatternLayers patterns, boolean append)
-
-
Method Details
-
run
Description copied from class:LootItemConditionalFunctionCalled to perform the actual action of this function, after conditions have been checked.- Specified by:
runin classLootItemConditionalFunction
-
codec
- Specified by:
codecin interfaceLootItemFunction- Specified by:
codecin classLootItemConditionalFunction
-
setBannerPattern
-