# Developer API

You can import ExcellentEnchants to your project using Maven. Replace {VERSION} with the latest version below:

<repository>
  <id>nightexpress-releases</id>
  <url>https://repo.nightexpressdev.com/releases</url>
</repository>

<dependency>
  <groupId>su.nightexpress.excellentenchants</groupId>
  <artifactId>Core</artifactId>
  <version>{VERSION}</version>
  <scope>provided</scope>
</dependency>

# Data Access

Get Excellent Enchant by NamespacedKey

NamespacedKey key = EnchantCatalog.TUNNEL.getKey();

// Using Paper API
Enchantment enchantment = RegistryAccess.registryAccess().getRegistry(RegistryKey.ENCHANTMENT).get(key);

// Using Spigot API
Enchantment enchantment = Registry.ENCHANTMENT.get(key);

// Using nightcore API
Enchantment enchantment = RegistryType.ENCHANTMENT.getRegistry().get(key);

// Using ExcellentEnchants API
CustomEnchantment custom = EnchantRegistry.getByKey(key);
Enchantment enchantment = custom.getBukkitEnchantment();

Get Excellent Enchant by ID

CustomEnchantment custom = EnchantRegistry.getById(EnchantCatalog.TUNNEL.getId());
Enchantment enchantment = custom.getBukkitEnchantment();

Check if Excellent Enchant is present

boolean exists = EnchantRegistry.isRegistered(EnchantCatalog.TUNNEL.getId());

Get all Excellent Enchants

Set<CustomEnchantment> customs = EnchantRegistry.getRegistered();