Skip to main content
The SkillsAPI interface is located at com.hacklab.minecraft.skills.api.SkillsAPI. Obtain an instance via the Bukkit ServicesManager as described in Getting started.

Skill operations

getSkill (by Player)

Returns the current value of a skill for an online player.
Player
required
The online player to query.
String
required
Skill name in any accepted format (display name, enum name, case-insensitive, spaces or underscores).
Double?
Skill value in the range 0.0100.0, or null if skillName does not match any known skill.

getSkill (by UUID)

Returns the current value of a skill looked up by UUID. Useful when you only have a UUID and the player may be offline in cache.
UUID
required
The UUID of the player.
String
required
Skill name in any accepted format.
Double?
Skill value 0.0100.0, or null if the skill name is invalid or the player’s data is not loaded.

setSkill

Sets a skill to an explicit value. The value is clamped to 0.0100.0 before being applied.
Player
required
The online player to modify.
String
required
Skill name in any accepted format.
Double
required
Target skill value. Automatically clamped to [0.0, 100.0].
Boolean
true if the skill was updated, false if skillName is invalid.

addSkill

Adds (or subtracts, if amount is negative) a delta to the current skill value. Respects the 0.0100.0 cap.
Player
required
The online player to modify.
String
required
Skill name in any accepted format.
Double
required
Amount to add. May be negative to reduce the skill.
Double?
The new skill value after the delta is applied, or null if skillName is invalid.

hasSkillLevel

Checks whether a player’s skill is at or above a threshold without requiring a null check on the caller side.
Player
required
The online player to check.
String
required
Skill name in any accepted format.
Double
required
The minimum required skill value.
Boolean
true if the player’s skill value is greater than or equal to minLevel. Returns false if the skill name is invalid.
Use hasSkillLevel() instead of comparing the result of getSkill() directly. It handles the invalid-skill case for you.

getAllSkills

Returns a snapshot of all 37 skill values for a player.
Player
required
The online player to query.
Map<String, Double>
Map keyed by skill display name (e.g. "Swordsmanship") with the current value as the entry. All 37 skills are always present; unlearned skills have a value of 0.0.

getTotalSkillPoints

Returns the sum of all skill values. The in-game cap is 700 points.
Player
required
The online player to query.
Double
Sum of all 37 skill values. Maximum is 700.0 (7 skills at 100.0).

Stat operations

STR, DEX, and INT are derived stats calculated automatically from the player’s skill values. They cannot be set directly; they update whenever the underlying skills change.

getStat

Returns the current value of a single derived stat.
Player
required
The online player to query.
String
required
One of "STR", "DEX", or "INT" (also accepts the long forms "STRENGTH", "DEXTERITY", "INTELLIGENCE").
Int?
Stat value 0100, or null if statName is not recognised.

getAllStats

Returns all three derived stats in a single call.
Player
required
The online player to query.
Map<String, Int>
Map with keys "STR", "DEX", and "INT" mapped to their current integer values.

HP, mana, and stamina

Skills maintains internal HP, mana, and stamina values that are separate from vanilla Minecraft hunger and hearts. HP is synchronised to vanilla hearts as a percentage.

getCurrentHp

Returns the player’s current internal HP.
Player
required
The online player to query.
Double
Current internal HP. Minimum 0.0; maximum equals getMaxHp().

getMaxHp

Returns the player’s maximum internal HP. Calculated as 100 + STR, giving a range of 100200.
Player
required
The online player to query.
Double
Maximum HP in the range 100.0200.0 based on the player’s STR stat.

getCurrentMana

Returns the player’s current mana. Mana is consumed by spell casting and is independent of the vanilla hunger bar.
Player
required
The online player to query.
Double
Current mana. Minimum 0.0; maximum 20.0.

getMaxMana

Returns the player’s maximum mana. The maximum is always 20.0. INT reduces the cost of spells rather than increasing the pool.
Player
required
The online player to query.
Double
Maximum mana. Always 20.0.

getCurrentStamina

Returns the player’s current stamina. Stamina is consumed while sprinting.
Player
required
The online player to query.
Double
Current stamina. Minimum 0.0; maximum equals getMaxStamina().

getMaxStamina

Returns the player’s maximum stamina. Calculated as 100 + DEX + (Focus / 2), giving a maximum of 250.0 when DEX and Focus are both 100.
Player
required
The online player to query.
Double
Maximum stamina. Range 100.0250.0 depending on DEX stat and Focus skill.

restoreMana

Adds mana to the player, capped at the maximum.
Player
required
The online player to restore mana for.
Double
required
Amount of mana to restore. Excess is discarded.

restoreStamina

Adds stamina to the player, capped at the maximum.
Player
required
The online player to restore stamina for.
Double
required
Amount of stamina to restore. Excess is discarded.

Utility

getAvailableSkillNames

Returns the display names of all 37 skills registered by the plugin.
List<String>
Ordered list of skill display names (e.g. ["Swordsmanship", "Axe", ...]). Use these as inputs to other skill methods.

isValidSkillName

Checks whether a string resolves to a known skill, using the same lenient matching as all other skill methods.
String
required
The string to validate.
Boolean
true if the name resolves to a known skill, false otherwise.

getTitle

Returns the player’s current title string, which is derived from their highest-ranked skills (e.g. "Grandmaster Swordsman").
Player
required
The online player to query.
String
Human-readable title string. The format depends on the player’s skill distribution.

Skill name reference

All skill names accepted by any API method. Matching is case-insensitive; spaces and underscores are interchangeable.