API Integration
The Strengthen API lets other plugins read strengthen levels, execute strengthening, listen to results, or migrate custom equipment data. Prefer configuration and GUI for normal gameplay.
Requirements
yaml
softdepend:
- EmakiStrengthenThe caller should handle the module being absent. ItemStack and inventory changes must run on the main server thread.
Common capabilities
| Capability | Description |
|---|---|
| Read level | Read current strengthen level and guarantee counters. |
| Validate | Check recipe, materials, permissions, limits, and economy cost. |
| Execute | Apply strengthening and return the updated item. |
| Rebuild display | Refresh lore, name, or attributes. |
| Listen to events | React to success, failure, downgrade, destroy, or protection. |
Example
java
ItemStack item = player.getInventory().getItemInMainHand();
int level = strengthenService.getLevel(item);
StrengthenResult result = strengthenService.tryStrengthen(player, item, "weapon_basic");
if (result.success()) {
player.getInventory().setItemInMainHand(result.item());
}