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

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

@Experimental @NullMarked @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
    Gets the builder for the entry being added to the registry.
    <V extends Keyed>
    Tag<V>
    Gets or creates a tag for the given tag key.
    key()
    Gets the key for this entry in the registry.

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

    registryKey
  • Method Details

    • builder

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

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

      <V extends Keyed> Tag<V> getOrCreateTag(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