Interface RegistryEntryAddEvent<T,B extends RegistryBuilder<T>>

Type Parameters:
T - registry entry type
B - registry entry builder type
All Superinterfaces:
LifecycleEvent, RegistryEvent<T>

@Experimental @NonExtendable public interface RegistryEntryAddEvent<T,B extends RegistryBuilder<T>> extends RegistryEvent<T>
Event object for RegistryEventProvider.entryAdd(). This event is fired right before a specific entry is registered in/added to registry. It provides a way for plugins to modify parts of this entry.
  • Method Summary

    Modifier and Type
    Method
    Description
    @NonNull B
    Gets the builder for the entry being added to the registry.
    <V extends Keyed>
    @NonNull Tag<V>
    getOrCreateTag(@NonNull TagKey<V> tagKey)
    Gets or creates a tag for the given tag key.
    @NonNull TypedKey<T>
    key()
    Gets the key for this entry in the registry.

    Methods inherited from interface io.papermc.paper.registry.event.RegistryEvent

    registryKey
  • Method Details

    • builder

      @NonNull B builder()
      Gets the builder for the entry being added to the registry.
      Returns:
      the object builder
    • key

      @NonNull TypedKey<T> key()
      Gets the key for this entry in the registry.
      Returns:
      the key
    • getOrCreateTag

      <V extends Keyed> @NonNull Tag<V> getOrCreateTag(@NonNull TagKey<V> tagKey)
      Gets or creates a tag for the given tag key. This tag is then required to be filled either from the built-in or custom datapack.
      Type Parameters:
      V - the tag value type
      Parameters:
      tagKey - the tag key
      Returns:
      the tag