HyronicHyronic Mcmmo Docs

Developer API

How other plugins integrate with mcMMO - the static API classes, the full set of custom Bukkit events, Maven coordinates, and PlaceholderAPI hooks.

mcMMO exposes a developer API so other plugins can read and modify player skill data, react to mcMMO events, and change behavior at runtime. This page is for plugin developers; server owners looking to wire mcMMO into existing plugins want the Integrations page instead.

Everything here is verified against mcMMO 2.2.054 source. Method signatures and event names change between major versions - always check against the jar you compile against.

Adding mcMMO as a dependency

mcMMO is published to the CodeMC repository. Maven coordinates:

<repository>
    <id>codemc-repo</id>
    <url>https://repo.codemc.io/repository/maven-public/</url>
</repository>

<dependency>
    <groupId>com.gmail.nossr50.mcMMO</groupId>
    <artifactId>mcMMO</artifactId>
    <version>2.2.054</version>
    <scope>provided</scope>
</dependency>

Declare mcMMO in your plugin.yml so it loads first:

depend: [mcMMO]        # hard dependency - your plugin won't load without mcMMO
# or
softdepend: [mcMMO]    # optional - load after mcMMO if it's present

Static API classes

The public API lives in com.gmail.nossr50.api. Each class is a collection of static methods - you don't instantiate them.

ClassPurpose
ExperienceAPIRead and grant XP, query levels and leaderboard ranks (online and offline).
SkillAPIList skill names by category (all, child, combat, gathering, misc).
PartyAPIRead party membership, add/remove members, get and set the leader.
AbilityAPICheck whether a super ability is active and set/reset cooldowns.
ChatAPIQuery and toggle a player's party-chat / admin-chat mode.
DatabaseAPICheck whether a player exists in the mcMMO database.

A few representative calls:

import com.gmail.nossr50.api.ExperienceAPI;
import com.gmail.nossr50.api.PartyAPI;
import com.gmail.nossr50.api.AbilityAPI;

// Grant 100 raw XP in Mining (respects multipliers when using addXP variants)
ExperienceAPI.addRawXP(player, "MINING", 100);

// Read a level
int mining = ExperienceAPI.getLevel(player, "MINING");

// Party checks
boolean teamed = PartyAPI.inSameParty(playerA, playerB);
String partyName = PartyAPI.getPartyName(player);

// Super ability state
boolean digging = AbilityAPI.gigaDrillBreakerEnabled(player);

Skill-type strings are case-insensitive skill names ("MINING", "SWORDS", "HERBALISM", …). Passing an invalid name throws - call ExperienceAPI.isValidSkillType(name) first if the value comes from user input.

Some ExperienceAPI methods also take an XP gain reason (XPGainReason) and an XP gain source so your XP grants fire the proper events and respect server settings. There are …Offline variants that accept a player name or UUID for editing players who aren't online.

Events

mcMMO fires custom Bukkit events you can listen to with a normal @EventHandler. Most are cancellable or expose setters so you can change XP amounts, drops, or outcomes before they apply. They live under com.gmail.nossr50.events.

Experience & levels

EventFires when
McMMOPlayerXpGainEventA player is about to gain skill XP (set the amount or cancel).
McMMOPlayerPreXpGainEventBefore XP is calculated.
McMMOPlayerLevelUpEventA skill levels up.
McMMOPlayerLevelDownEventA skill loses a level.
McMMOPlayerLevelChangeEventAny level change (base class).

Skills & abilities

EventFires when
McMMOPlayerAbilityActivateEventA super ability is activated.
McMMOPlayerAbilityDeactivateEventA super ability ends.
SubSkillEvent / SubSkillRandomCheckEvent / SubSkillBlockEventA sub-skill triggers or rolls its chance.
McMMOPlayerRepairCheckEvent / McMMOPlayerSalvageCheckEventA repair or salvage is attempted.
McMMOPlayerFishingTreasureEvent / McMMOPlayerShakeEvent / McMMOPlayerMagicHunterEventFishing results.
McMMOPlayerTameEntityEvent / McMMOPlayerDisarmEventTaming / Unarmed disarm.
McMMOPlayerBrewEvent / McMMOPlayerCatalysisEventAlchemy brewing.
McMMOEntityDamageByRuptureEventRupture deals damage.

Parties

EventFires when
McMMOPartyChangeEventA player joins or leaves a party.
McMMOPartyLevelUpEventA party gains a level.
McMMOPartyXpGainEventA party gains XP.
McMMOPartyTeleportEventA party teleport happens.
McMMOPartyAllianceChangeEventA party alliance changes.

Chat, items, profiles & hardcore

EventFires when
McMMOChatEvent / McMMOPartyChatEvent / McMMOAdminChatEventmcMMO chat channels.
McMMOItemSpawnEvent / McMMOModifyBlockDropItemEventmcMMO spawns or modifies drops.
McMMOPlayerProfileLoadEventA player's profile finishes loading.
McMMOPlayerDeathPenaltyEvent / McMMOPlayerStatLossEvent / McMMOPlayerVampirismEventHardcore-mode penalties.
McMMOScoreboard*EventmcMMO scoreboard lifecycle.
@EventHandler
public void onXpGain(McMMOPlayerXpGainEvent event) {
    if (event.getSkill() == PrimarySkillType.MINING) {
        event.setRawXpGained(event.getRawXpGained() * 2); // double mining XP
    }
}

mcMMO also fires fake events (FakeBlockBreakEvent, FakePlayerFishEvent, etc.) to drive vanilla mechanics without side effects. Check event instanceof FakeEvent and ignore them in your listeners, or you'll double-process mcMMO's own actions.

PlaceholderAPI

mcMMO ships a built-in PlaceholderAPI expansion (identifier mcmmo) that registers automatically when PlaceholderAPI is installed. The full list of %mcmmo_…% placeholders is documented on the Integrations page.

Anonymous metrics (bStats)

mcMMO reports anonymous stats to bStats. This is mcMMO's own telemetry, not an API - see Integrations → bStats to opt out.

On this page