Class CopyComponentsFunction
java.lang.Object
net.minecraft.world.level.storage.loot.functions.LootItemConditionalFunction
net.minecraft.world.level.storage.loot.functions.CopyComponentsFunction
- All Implemented Interfaces:
BiFunction<ItemStack,,LootContext, ItemStack> LootItemFunction,LootContextUser
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final recordstatic class(package private) static final record(package private) static final recordstatic interfaceNested classes/interfaces inherited from class net.minecraft.world.level.storage.loot.functions.LootItemConditionalFunction
LootItemConditionalFunction.DummyBuilder -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Predicate<DataComponentType<?>> static final com.mojang.serialization.MapCodec<CopyComponentsFunction> private final Optional<List<DataComponentType<?>>> private final Optional<List<DataComponentType<?>>> private final CopyComponentsFunction.Source<?> private static final ExtraCodecs.LateBoundIdMapper<String, CopyComponentsFunction.Source<?>> Fields inherited from class net.minecraft.world.level.storage.loot.functions.LootItemConditionalFunction
predicates -
Constructor Summary
ConstructorsConstructorDescriptionCopyComponentsFunction(List<LootItemCondition> pConditions, CopyComponentsFunction.Source<?> pSource, Optional<List<DataComponentType<?>>> pInclude, Optional<List<DataComponentType<?>>> pExclude) -
Method Summary
Modifier and TypeMethodDescriptioncopyComponentsFromBlockEntity(ContextKey<? extends BlockEntity> pContextParam) copyComponentsFromEntity(ContextKey<? extends Entity> pContextParam) Set<ContextKey<?>> getType()run(ItemStack p_330563_, LootContext p_331220_) Called to perform the actual action of this function, after conditions have been checked.Methods inherited from class net.minecraft.world.level.storage.loot.functions.LootItemConditionalFunction
apply, commonFields, simpleBuilder, validateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.function.BiFunction
andThen
-
Field Details
-
SOURCES
-
CODEC
-
source
-
include
-
exclude
-
bakedPredicate
-
-
Constructor Details
-
CopyComponentsFunction
CopyComponentsFunction(List<LootItemCondition> pConditions, CopyComponentsFunction.Source<?> pSource, Optional<List<DataComponentType<?>>> pInclude, Optional<List<DataComponentType<?>>> pExclude)
-
-
Method Details
-
getType
- Specified by:
getTypein interfaceLootItemFunction- Specified by:
getTypein 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
-
copyComponentsFromEntity
public static CopyComponentsFunction.Builder copyComponentsFromEntity(ContextKey<? extends Entity> pContextParam) -
copyComponentsFromBlockEntity
public static CopyComponentsFunction.Builder copyComponentsFromBlockEntity(ContextKey<? extends BlockEntity> pContextParam)
-