Interface DefaultItemComponentEvents.ModifyContext

Enclosing class:
DefaultItemComponentEvents

public static interface DefaultItemComponentEvents.ModifyContext
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    modify(Collection<net.minecraft.world.item.Item> items, BiConsumer<net.minecraft.core.component.DataComponentMap.Builder, net.minecraft.world.item.Item> builderConsumer)
    Modify the default data components of the specified items.
    void
    modify(Predicate<net.minecraft.world.item.Item> itemPredicate, BiConsumer<net.minecraft.core.component.DataComponentMap.Builder, net.minecraft.world.item.Item> builderConsumer)
    Modify the default data components of the specified item.
    default void
    modify(net.minecraft.world.item.Item item, Consumer<net.minecraft.core.component.DataComponentMap.Builder> builderConsumer)
    Modify the default data components of the specified item.
  • Method Details

    • modify

      void modify(Predicate<net.minecraft.world.item.Item> itemPredicate, BiConsumer<net.minecraft.core.component.DataComponentMap.Builder, net.minecraft.world.item.Item> builderConsumer)
      Modify the default data components of the specified item.
      Parameters:
      itemPredicate - A predicate to match items to modify
      builderConsumer - A consumer that provides a DataComponentMap.Builder to modify the item's components.
    • modify

      default void modify(net.minecraft.world.item.Item item, Consumer<net.minecraft.core.component.DataComponentMap.Builder> builderConsumer)
      Modify the default data components of the specified item.
      Parameters:
      item - The item to modify
      builderConsumer - A consumer that provides a DataComponentMap.Builder to modify the item's components.
    • modify

      default void modify(Collection<net.minecraft.world.item.Item> items, BiConsumer<net.minecraft.core.component.DataComponentMap.Builder, net.minecraft.world.item.Item> builderConsumer)
      Modify the default data components of the specified items.
      Parameters:
      items - The items to modify
      builderConsumer - A consumer that provides a DataComponentMap.Builder to modify the item's components.