Class SetNameFunction
java.lang.Object
net.minecraft.world.level.storage.loot.functions.LootItemConditionalFunction
net.minecraft.world.level.storage.loot.functions.SetNameFunction
- All Implemented Interfaces:
BiFunction<ItemStack,
,LootContext, ItemStack> LootItemFunction
,LootContextUser
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.world.level.storage.loot.functions.LootItemConditionalFunction
LootItemConditionalFunction.Builder<T extends LootItemConditionalFunction.Builder<T>>, LootItemConditionalFunction.DummyBuilder
-
Field Summary
Modifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec
<SetNameFunction> private static final org.slf4j.Logger
private final Optional
<LootContext.EntityTarget> private final SetNameFunction.Target
Fields inherited from class net.minecraft.world.level.storage.loot.functions.LootItemConditionalFunction
predicates
-
Constructor Summary
ModifierConstructorDescriptionprivate
SetNameFunction
(List<LootItemCondition> p_298434_, Optional<Component> p_299902_, Optional<LootContext.EntityTarget> p_300668_, SetNameFunction.Target p_327809_) -
Method Summary
Modifier and TypeMethodDescriptionstatic UnaryOperator
<Component> createResolver
(LootContext p_81140_, LootContext.EntityTarget p_81141_) Set
<LootContextParam<?>> getType()
run
(ItemStack p_81137_, LootContext p_81138_) static LootItemConditionalFunction.Builder
<?> setName
(Component p_165460_, SetNameFunction.Target p_336143_) static LootItemConditionalFunction.Builder
<?> setName
(Component p_165458_, SetNameFunction.Target p_335783_, LootContext.EntityTarget p_332047_) Methods inherited from class net.minecraft.world.level.storage.loot.functions.LootItemConditionalFunction
apply, commonFields, simpleBuilder, validate
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
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
CODEC
-
name
-
resolutionContext
-
target
-
-
Constructor Details
-
SetNameFunction
private SetNameFunction(List<LootItemCondition> p_298434_, Optional<Component> p_299902_, Optional<LootContext.EntityTarget> p_300668_, SetNameFunction.Target p_327809_)
-
-
Method Details
-
getType
- Specified by:
getType
in interfaceLootItemFunction
- Specified by:
getType
in classLootItemConditionalFunction
-
getReferencedContextParams
-
createResolver
public static UnaryOperator<Component> createResolver(LootContext p_81140_, @Nullable LootContext.EntityTarget p_81141_) -
run
- Specified by:
run
in classLootItemConditionalFunction
-
setName
public static LootItemConditionalFunction.Builder<?> setName(Component p_165460_, SetNameFunction.Target p_336143_) -
setName
public static LootItemConditionalFunction.Builder<?> setName(Component p_165458_, SetNameFunction.Target p_335783_, LootContext.EntityTarget p_332047_)
-