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, Validatable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final recordstatic classprivate static final record -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Predicate<DataComponentType<?>> private final Optional<List<DataComponentType<?>>> private static final Codec<LootContextArg<DataComponentGetter>> private final Optional<List<DataComponentType<?>>> static final MapCodec<CopyComponentsFunction> private final LootContextArg<DataComponentGetter> Fields inherited from class LootItemConditionalFunction
predicates -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateCopyComponentsFunction(List<LootItemCondition> predicates, LootContextArg<DataComponentGetter> source, Optional<List<DataComponentType<?>>> include, Optional<List<DataComponentType<?>>> exclude) -
Method Summary
Modifier and TypeMethodDescriptioncodec()copyComponentsFromBlockEntity(ContextKey<? extends BlockEntity> source) copyComponentsFromEntity(ContextKey<? extends Entity> source) Set<ContextKey<?>> run(ItemStack itemStack, LootContext context) 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
-
GETTER_CODEC
-
MAP_CODEC
-
source
-
include
-
exclude
-
bakedPredicate
-
-
Constructor Details
-
CopyComponentsFunction
private CopyComponentsFunction(List<LootItemCondition> predicates, LootContextArg<DataComponentGetter> source, Optional<List<DataComponentType<?>>> include, Optional<List<DataComponentType<?>>> exclude)
-
-
Method Details
-
codec
- Specified by:
codecin interfaceLootItemFunction- Specified by:
codecin classLootItemConditionalFunction
-
getReferencedContextParams
-
run
- Specified by:
runin classLootItemConditionalFunction
-
copyComponentsFromEntity
public static CopyComponentsFunction.Builder copyComponentsFromEntity(ContextKey<? extends Entity> source) -
copyComponentsFromBlockEntity
public static CopyComponentsFunction.Builder copyComponentsFromBlockEntity(ContextKey<? extends BlockEntity> source)
-