For the complete documentation index, see llms.txt. This page is also available as Markdown.

Developer API

The mc-TycoonHoe Developer API allows external plugins to integrate with mc-TycoonHoe features such as player hoe statistics, essence, armor boosters, crystals, custom enchants, and plugin events.

The API is designed for Paper plugins and should be used as a compileOnly dependency.


Available API Classes

Class
Purpose

McTycoonHoeAPI

Main API for player hoe stats, prestige, essence, armor and boosters

McTycoonHoeCrystalAPI

Utility API for damaging crystals on cached hoes

McTycoonHoeEnchantAPI

API for registering, unregistering and reading custom enchants


Package

com.mongenscave.mctycoonhoe.api

Installation

Gradle Kotlin DSL

Add the MonGens Cave repository:

repositories {
    maven("https://repo.mongenscave.com/releases")
}

Add the API dependency:

Maven


Plugin Dependency

Your plugin must load after mc-TycoonHoe.

For plugin.yml:

If the installed plugin name is different in the plugin’s plugin.yml, use that exact name.


Quick Start

Accessing the Main API

Most main API methods return CompletableFuture, because they may use database operations.

Do not block the server thread with .join() or .get().

Correct usage:

If you need to run Bukkit API logic after an async callback, switch back to the server thread using your plugin scheduler.


Core API

Class:

Access:


Methods

Get Highest Hoe Level

Returns the highest hoe level owned by the player.

Example:


Get Highest Prestige Level

Returns the highest prestige level owned by the player.

Example:


Get Hoe Count

Returns how many hoes the player owns.

Example:


Get Essence

Returns the player’s essence amount.

If the player has no stored essence data, the API returns 0.

Example:


Give Essence

Adds essence to a player.

Example:


Take Essence

Attempts to remove essence from a player.

Returns true if the player had enough essence and the amount was removed.

Returns false if the player did not have enough essence.

Example:


Get Active Armor

Returns the player’s active armor id, if one is equipped.

Example:


Get Armor Booster

Returns the current armor booster value for the player and booster key.

Example:


Crystal API

Class:

The Crystal API currently provides a static utility method for damaging a crystal inside a hoe.


Damage Crystal

Damages a crystal inside a specific hoe slot.

If the crystal reaches 0 durability, the crystal will be removed from the slot.

Example:


Important Notes

This method silently does nothing if:

  • the hoe is not currently cached

  • the crystal slot does not exist

  • the crystal slot is empty

  • the crystal is already broken

Crystal indexes are slot-based. Make sure you use the correct crystal slot index from your own integration logic.


Enchant API

Class:

Access:

The Enchant API allows external plugins to register custom enchants into mc-TycoonHoe.


Register Custom Enchant

Registers a custom enchant.

Returns:

Value
Meaning

true

The enchant was registered as a new enchant

false

An enchant with the same id already existed and was replaced

The enchant id is case-insensitive and must be unique.

Example:


Unregister Custom Enchant

Removes an API-registered enchant.

Built-in and config-defined enchants cannot be removed using this method.

Example:


Check If Enchant Exists

Checks whether an enchant is currently registered.

This includes built-in, config-defined and API-registered enchants.

Example:


Get Enchant

Returns the registered enchant by id.

Returns null if no enchant exists with that id.

Example:


Get Registered Enchant IDs

Returns an immutable snapshot of all registered enchant ids.

The returned ids are uppercase.

Example:


Register Timing

Register custom enchants in your plugin’s onEnable.

Your plugin should depend on mc-TycoonHoe, otherwise the API may not be ready yet.

Example:

If mc-TycoonHoe is not fully enabled yet, the API can throw an IllegalStateException.


Events

mc-TycoonHoe exposes multiple Bukkit events that can be listened to from external plugins.

Register listeners like normal Paper/Bukkit events.

Example:

Register the listener:


General Events

Package:

Available events:

Event
Description

CropHarvestEvent

Called when a crop is harvested through mc-TycoonHoe

EssenceGainEvent

Called when a player gains essence

HoeXpGainEvent

Called when a hoe gains XP

HoeLevelUpEvent

Called when a hoe levels up

PrestigeLevelUpEvent

Called when a hoe prestige level increases

Example:


Boss Events

Package:

Available events:

Event
Description

BossStartEvent

Called when a boss encounter starts

BossDamageEvent

Called when a boss takes damage

BossEndEvent

Called when a boss encounter ends

Example:


Condense Events

Package:

Available events:

Event
Description

CondensePrepareEvent

Called before a condense action is completed

CondenseCompleteEvent

Called after a condense action is completed

Example:


Enchant Events

Package:

Available events:

Event
Description

EnchantPurchasePreEvent

Called before an enchant purchase is completed

EnchantPurchaseCompleteEvent

Called after an enchant purchase is completed

Example:


Cancellable Events

Some events may implement Bukkit’s Cancellable.

If an event implements Cancellable, you can cancel it like this:

Always check the event class or IDE autocomplete to see whether the event supports cancellation.


Best Practices

Do Not Block the Main Thread

Many API methods return CompletableFuture.

Avoid this:

Use this instead:


Use depend, Not softdepend

If your plugin directly imports and uses mc-TycoonHoe API classes, use depend.

Use softdepend only if you check for the plugin before touching API classes.


Validate Input

Always validate values before calling API methods.

Example:


Register Enchants During Startup

Custom enchants should be registered during plugin startup.

Recommended:

Avoid registering enchants repeatedly during gameplay unless you intentionally want to replace an existing enchant.


Handle Optional Values

Some API methods return Optional.

Example:


Full Example


Version

Current API artifact:

Recommended Java version:

Recommended server platform:

Last updated