Class AbstractEnchantID

java.lang.Object
com.kamikazejam.kamicommon.nms.abstraction.enchantid.AbstractEnchantID

public abstract class AbstractEnchantID extends Object
Abstract class providing version-specific implementations for retrieving namespaced identifiers of Minecraft enchantments.

This abstraction handles the differences in enchantment identification across different Minecraft versions, particularly the transition from numeric IDs to namespaced identifiers that occurred in 1.13+.

  • Constructor Details

    • AbstractEnchantID

      public AbstractEnchantID()
  • Method Details

    • getNamespaced

      @NotNull public abstract @NotNull String getNamespaced(Enchantment enchantment)
      Retrieves the namespaced identifier for the given enchantment.

      This method returns the string representation of an enchantment that can be used for serialization, configuration storage, or cross-version compatibility. The format may vary depending on the Minecraft version.

      Parameters:
      enchantment - the Enchantment to get the identifier for
      Returns:
      the namespaced string identifier for the enchantment (i.e. "minecraft:sharpness")