Interface TagChannel

All Known Implementing Classes:
ModuleContributions

@Experimental @NonExtendable public interface TagChannel
Item and enchantment tag changes declared 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
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Set<io.papermc.paper.registry.RegistryKey<?>>
    The registries available to this channel.
  • Method Summary

    Modifier and Type
    Method
    Description
    <T extends org.bukkit.Keyed>
    void
    addToTag(io.papermc.paper.registry.RegistryKey<T> registry, net.kyori.adventure.key.Key tag, Collection<net.kyori.adventure.key.Key> values)
    Adds values to an existing or new tag of the given registry; any namespace may be extended.
    <T extends org.bukkit.Keyed>
    void
    setTag(io.papermc.paper.registry.RegistryKey<T> registry, net.kyori.adventure.key.Key tag, Collection<net.kyori.adventure.key.Key> values)
    Creates or replaces a tag in this module's namespace with exactly these values.
  • Field Details

    • SUPPORTED

      static final Set<io.papermc.paper.registry.RegistryKey<?>> SUPPORTED
      The registries available to this channel.
  • Method Details

    • addToTag

      <T extends org.bukkit.Keyed> void addToTag(io.papermc.paper.registry.RegistryKey<T> registry, net.kyori.adventure.key.Key tag, Collection<net.kyori.adventure.key.Key> values)
      Adds values to an existing or new tag of the given registry; any namespace may be extended.
      Type Parameters:
      T - the registry value type
      Parameters:
      registry - a supported registry
      tag - the tag key
      values - the entry keys to add
      Throws:
      IllegalArgumentException - if the registry is not supported
      IllegalStateException - if called after bootstrap() returned
    • setTag

      <T extends org.bukkit.Keyed> void setTag(io.papermc.paper.registry.RegistryKey<T> registry, net.kyori.adventure.key.Key tag, Collection<net.kyori.adventure.key.Key> values)
      Creates or replaces a tag in this module's namespace with exactly these values.
      Type Parameters:
      T - the registry value type
      Parameters:
      registry - a supported registry
      tag - the tag key
      values - the replacement entry keys
      Throws:
      IllegalArgumentException - if the registry is not supported or the tag is outside this module's namespace
      IllegalStateException - if called after bootstrap() returned