Developer API

BusyMining exposes a small API for other plugins. Add BusyMining to depend or softdepend in your plugin.yml, and compile against it from BusyBee's Maven repository. Replace VERSION with the BusyMining version you build against; 26.10.1 is the first one published there.

Maven:

xml

    busybee
    https://repo.busybeedev.net/public-releases



    net.busybee.busymining
    BusyMining
    VERSION
    provided
    
        
            *
            *
        
    

Gradle:

kotlin
repositories {
    maven("https://repo.busybeedev.net/public-releases")
}

dependencies {
    compileOnly("net.busybee.busymining:BusyMining:VERSION") { isTransitive = false }
}

The jar is shaded and the published pom still lists BusyMining's own dependencies, so exclude transitives as shown.

Getting the API

java
BusyMiningAPI api = BusyMining.getAPI();

BusyMining is net.busybee.busyMining.BusyMining; the API interface is net.busybee.busyMining.api.BusyMiningAPI. getAPI() returns null until BusyMining has finished enabling.

Methods

Method Returns
getPlayerData(Player) CompletableFuture<PlayerData>: completes straight away for online players, otherwise loads from the database
getMiningLevel(Player) Mining level
getZeta(Player) Zeta balance
addZeta(Player, int) Adds exactly that much Zeta (no perk bonuses). Works for offline players
addMiningXP(Player, int) Adds mining XP, levelling the player up as needed. Works for offline players
getSingularityLevel(Player) Singularity level
getOraclesKilled(Player) Oracles killed

Reads and writes go through BusyMining's cache for online players, so they're safe to call from the player's own thread. For a player who isn't loaded, the plain getters wait on the database, so don't call them for offline players from a server or region thread; use getPlayerData instead.

Events

net.busybee.busyMining.api.event.ArtifactIdentifyEvent fires when a player collects a finished item from the Artifact Identifier.

Getter Value
getPlayer() The player
getArtifactName() "Artifact" or "Fossil"
getTier() The artifact tier (COMMON ... DIVINE), or the fossil species (DRAGON, PHOENIX, MANTICORE, WRAITH)

net.busybee.busyMining.modules.EnchantmentModule.ExtraBlockBreakEvent extends BlockBreakEvent. It fires for every extra block broken by Explosive, Vein Miner or Sonic, and for every block a minion is about to mine, with the minion's owner as the player. Cancelling it keeps that block. Check EnchantmentModule.isExtraBreak(event) in your own BlockBreakEvent listener if you need to tell these apart from normal breaks; BusyMining's own rewards ignore them.

Custom items

BusyMining items carry the persistent data key busymining:item_id (a string) holding their /bmine give id. For item families it's just the family name: gemstone, not gemstone:3. Mining Tomes and items made by very old versions don't carry it.