Class SetLoreFunction
java.lang.Object
net.minecraft.world.level.storage.loot.functions.LootItemConditionalFunction
net.minecraft.world.level.storage.loot.functions.SetLoreFunction
- All Implemented Interfaces:
BiFunction<ItemStack,
,LootContext, ItemStack> LootItemFunction
,LootContextUser
LootItemFunction that sets a stack's lore tag, optionally replacing any previously present lore.
The Components for the lore tag are optionally resolved relative to a given
LootContext.EntityTarget
for entity-sensitive component data such as scoreboard scores.-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class net.minecraft.world.level.storage.loot.functions.LootItemConditionalFunction
LootItemConditionalFunction.DummyBuilder
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec
<SetLoreFunction> private final ListOperation
private final Optional
<LootContext.EntityTarget> Fields inherited from class net.minecraft.world.level.storage.loot.functions.LootItemConditionalFunction
predicates
-
Constructor Summary
ConstructorsConstructorDescriptionSetLoreFunction
(List<LootItemCondition> p_81085_, List<Component> p_298633_, ListOperation p_335651_, Optional<LootContext.EntityTarget> p_298623_) -
Method Summary
Modifier and TypeMethodDescriptionSet
<LootContextParam<?>> getType()
run
(ItemStack pStack, LootContext pContext) Called to perform the actual action of this function, after conditions have been checked.static SetLoreFunction.Builder
setLore()
updateLore
(ItemLore pItemLore, LootContext pContext) 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
-
CODEC
-
lore
-
mode
-
resolutionContext
-
-
Constructor Details
-
SetLoreFunction
public SetLoreFunction(List<LootItemCondition> p_81085_, List<Component> p_298633_, ListOperation p_335651_, Optional<LootContext.EntityTarget> p_298623_)
-
-
Method Details
-
getType
- Specified by:
getType
in interfaceLootItemFunction
- Specified by:
getType
in classLootItemConditionalFunction
-
getReferencedContextParams
-
run
Called to perform the actual action of this function, after conditions have been checked.- Specified by:
run
in classLootItemConditionalFunction
-
updateLore
-
setLore
-