Class FillPlayerHead
java.lang.Object
net.minecraft.world.level.storage.loot.functions.LootItemConditionalFunction
net.minecraft.world.level.storage.loot.functions.FillPlayerHead
- All Implemented Interfaces:
BiFunction<ItemStack, LootContext, ItemStack>, LootItemFunction, LootContextUser, Validatable
LootItemFunction that applies the
"SkullOwner" NBT tag to any player heads based on the given LootContext.EntityTarget.
If the given target does not resolve to a player, nothing happens.-
Nested Class Summary
Nested classes/interfaces inherited from class LootItemConditionalFunction
LootItemConditionalFunction.Builder<T> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final LootContext.EntityTargetstatic final com.mojang.serialization.MapCodec<FillPlayerHead> Fields inherited from class LootItemConditionalFunction
predicates -
Constructor Summary
ConstructorsConstructorDescriptionFillPlayerHead(List<LootItemCondition> predicates, LootContext.EntityTarget entityTarget) -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.MapCodec<FillPlayerHead> codec()static LootItemConditionalFunction.Builder<?> fillPlayerHead(LootContext.EntityTarget entityTarget) Set<ContextKey<?>> run(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
-
entityTarget
-
-
Constructor Details
-
FillPlayerHead
-
-
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
-
fillPlayerHead
public static LootItemConditionalFunction.Builder<?> fillPlayerHead(LootContext.EntityTarget entityTarget)
-