Interface ModifyDefaultComponentsEvent.Initializer

Enclosing class:
ModifyDefaultComponentsEvent
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public static interface ModifyDefaultComponentsEvent.Initializer
A alternate version of DataComponentInitializers.Initializer which receives the item whose components being initialized.
  • Method Details

    • run

      void run(DataComponentMap.Builder components, HolderLookup.Provider context, Item item)
      Initializes or modifies the default components of a given item.
      Parameters:
      components - the default components of the item
      context - the registry context
      item - the item
    • andThen

      Returns a composed initializer that first runs this initializer, and then runs the given initializer.
      Parameters:
      other - the initializer to apply after this initializer is run
      Returns:
      a composed initializer that first runs this initializer, and then runs the given initializer