â¨ī¸ Developer API
MMOitemsUpgrade provides a stable API for developers to integrate upgrade logic into other plugins or read data.
đ ī¸ Core API Methodsâ
1. Get Upgrade Levelâ
Read the current level of an item.
// Returns Int?, null if not an upgrade item
val level = UpgradeAPI.getUpgradeLevel(itemStack)
2. Restore Upgrade Statsâ
If other plugins reset item attributes (e.g., by modifying NBT), call this to force-read the level and re-apply stats, effects, and abilities.
// Returns ItemStack with reconstructed bonuses
val newItem = UpgradeAPI.restoreUpgradeStats(itemStack)
3. Set Item Levelâ
Manual modification (no costs incurred).
UpgradeAPI.setUpgradeLevel(itemStack, 10)
đ Core UUID Constantsâ
Uses predefined UUIDs for StatModifiers to prevent conflicts:
NAME_SUFFIX_UUID: For name suffix ([+10]).PERM_EFFECTS_UUID: For potion effects.ABILITIES_UUID: For dynamic abilities.