EnchantmentSlots Wiki
For 4.1.8
For 4.1.8
  • 🎉Welcome
  • 📦Info
    • ✅Requirements
    • ⚙️Install
      • Extra Step: Custom Enchantments Plugin Compatibility
    • ⛔Limitation
    • 🔗Compatibility
      • MythicChanger Hook
    • 🛠️Configuration files
    • ⌨️Commands
    • ❓FAQ
    • 🚀Performance
  • 📋Format
    • 📝ItemFormat™ (Simply version)
    • 🎬Action Format
    • ⚖️Condition Format
  • 🤖Auto Add Lore
    • 🔮Item can be enchanted
    • ⚡Auto Add Lore
  • 🎯Enchantment Slot
    • ↔️Default Slot/Max Slot
    • #️⃣Set Slot
  • ✨Features
    • 🎨Color Code
    • 🪄Extra Slot Item
    • 📍Item Placeholder
  • 💻Develop
    • API Download
    • Useful Methods
Powered by GitBook
On this page
  1. 💻Develop

Useful Methods

Obtain Max Enchantment Limit for the ItamStack object (ItemLimits.java)

/*
Obtain the current maximum enchantment limit of the ItemStack object. The maximum enchantment limit is stored in the item NBT.
If it cannot be obtained, the default slot value is used.

Plugin has built-in default slot system, you can use ConfigReader.getDefaultLimits(player, itemID) method to default slot in this item.
For itemID parameter: You can first use checkValid(ItemStack item) method to parse it into String object here.
 */
public static int getMaxEnchantments(@NotNull ItemStack item, int defaultSlot, @NotNull ItemStack itemID) {
    return 0;
}
/*
Similar to getMaxEnchantments method, but cannot obtain maximum enchantment limit, we will just return 0 instead of return a default value.
 */
public static int getRealMaxEnchantments(@NotNull ItemStack item) {
    return 0;
}
PreviousAPI Download