Skip to content

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:
  - EmakiStrengthen

The caller should handle the module being absent. ItemStack and inventory changes must run on the main server thread.

Common capabilities

CapabilityDescription
Read levelRead current strengthen level and guarantee counters.
ValidateCheck recipe, materials, permissions, limits, and economy cost.
ExecuteApply strengthening and return the updated item.
Rebuild displayRefresh lore, name, or attributes.
Listen to eventsReact 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());
}