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 TypeMethodDescriptionvoidregister(net.kyori.adventure.key.Key key, EnchantmentDefinition definition) Declares a new enchantment.
-
Method Details
-
register
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 keydefinition- the builder callback- Throws:
IllegalArgumentException- if the key is outside this module's namespace or declared twiceIllegalStateException- if called after bootstrap() returned
-