Repository navigation
API
For maven, first add the Jitpack repository to your repositories if you haven't already:
<repository>
<id>jitpack.io</id>
<url>https://www.jitpack.io</url>
</repository>And add the following in your dependencies:
<dependency>
<groupId>com.github.MidenTheDev</groupId>
<artifactId>NouveauEnchantingV2</artifactId>
<version>LATEST-RELEASE</version>
<scope>provided</scope>
</dependency>For Gradle, you first have to add the Jitpack repository in your settings.gradle file at the end of your repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url 'https://www.jitpack.io' }
}
}Then add the following in your dependencies:
dependencies {
compileOnly 'com.github.MidenTheDev:NouveauEnchantingV2:LATEST-RELEASE'
}The PlayerEnchantEvent fires when a player completes an enchant using the NEW SYSTEM ONLY! This event does NOT fire when using the vanilla enchanting table OR when using an anvil.
The event is NOT cancelable, but I intend to make it cancelable in the future.
The event is registered just like any other Bukkit event and provides the following methods:
-
getPlayer()- Returns the player who was trying to enchant -
getEnchantment()- Returns the Enchantment involved in the enchanting -
getEnchantmentLevel()- Returns the level of the Enchantment being applied to the item -
getEnchantMaterial()- Returns the EnchantMaterial involved in the enchanting process -
getMaterialCost()- Returns the amount of the material consumed by enchanting -
getExpCost()- returns the amount of exp in levels consumed by enchanting
The EnchantMaterial class represents a material used in an enchanting recipe from the plugin. It contains the vanilla Material, the list of enchantments the material is used for, the name of the material, and the information needed to reconstruct the item if it is a Custom Item provided by a compatible plugin such as ItemsAdder.
This class should NEVER be constructed directly, and should only be returned by other API methods or the Material registry.