Interface EnchantmentChannel

All Known Implementing Classes:
ModuleContributions

@Experimental @NonExtendable public interface EnchantmentChannel
Declarations of new enchantments made by one module. Experimental: these channels use Paper's bootstrap lifecycle and RegistryEvents.ENCHANTMENT. Paper 26.3 marks PluginBootstrap, LifecycleEvents.TAGS, LifecycleEvents.DATAPACK_DISCOVERY and io.papermc.paper.registry.tag.Tag experimental. A later 7.x release may adapt this interface to Paper changes; see COMPATIBILITY.md.
Since:
7.0.0
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    register(net.kyori.adventure.key.Key key, EnchantmentDefinition definition)
    Declares a new enchantment.
  • Method Details

    • register

      void register(net.kyori.adventure.key.Key key, EnchantmentDefinition definition)
      Declares a new enchantment. The key's namespace must equal this module's namespace. The definition runs later, once, while Paper composes the enchantment registry.
      Parameters:
      key - the new enchantment key
      definition - the builder callback
      Throws:
      IllegalArgumentException - if the key is outside this module's namespace or declared twice
      IllegalStateException - if called after bootstrap() returned