RPGMobs-api artifact so your mod only depends on the lightweight API interfaces, not the full plugin.
Setup
Dependency
Add the API JAR as a compile-only dependency in yourbuild.gradle:
-javadoc.jar and -sources.jar are available as additional downloads. Place all three in your libs/ folder for full IDE support (autocomplete, inline docs, click-to-source).
Mod Manifest
Declare RPGMobs as a dependency in your mod’smanifest.json so Hytale loads it before your mod:
Entry Point
All API access goes through the staticRPGMobsAPI class:
RPGMobsNotInitializedException.
Event System
ImplementIRPGMobsEventListener and override the events you care about. All handler methods have default no-op implementations, so you only need to override what you use.
Available Events
| Event | Fired when | Cancellable | Mutable fields |
|---|---|---|---|
RPGMobsSpawnedEvent | Elite enters the world | Yes | — |
RPGMobsDeathEvent | Elite dies | No | — |
RPGMobsDropsEvent | Loot is about to spawn | Yes | getDrops() (live list) |
RPGMobsDamageDealtEvent | Elite deals outgoing damage | Yes | setMultiplier(float) |
RPGMobsDamageReceivedEvent | Elite takes incoming damage | No | — |
RPGMobsAbilityStartedEvent | Ability execution begins | Yes | — |
RPGMobsAbilityCompletedEvent | Ability finishes normally | No | — |
RPGMobsAbilityInterruptedEvent | Ability was interrupted | No | getReason() |
RPGMobsAggroEvent | Elite targets an entity | No | targetRef() |
RPGMobsDeaggroEvent | Elite loses its target | No | — |
RPGMobsScalingAppliedEvent | Scaling parameters computed | No | All fields (read-only record) |
RPGMobsReconcileEvent | Config reconciliation pass | No | — |
Base Event Fields
Every event extendsRPGMobsEvent which provides:
getEntityRef()— the RPG mob’sRef<EntityStore>getTier()— zero-based tier index (0 = Tier 1, 4 = Tier 5)getRoleName()— the NPC role identifier (e.g."Skeleton_Frost_Knight")
Cancelling Events
Events that implementICancellable can be cancelled to prevent the action:
RPGMobsSpawnedEvent, RPGMobsDropsEvent, RPGMobsDamageDealtEvent, RPGMobsAbilityStartedEvent.
Query API
The Query API provides read-only access to any RPG mob’s current state. Access it viaRPGMobsAPI.query().
Identity
| Method | Returns | Description |
|---|---|---|
isRPGMob(ref) | boolean | Whether the entity is an RPGMobs elite |
getTier(ref) | Optional<Integer> | Zero-based tier index |
Scaling
| Method | Returns | Description |
|---|---|---|
getHealthMultiplier(ref) | Optional<Float> | Applied health multiplier |
getDamageMultiplier(ref) | Optional<Float> | Applied damage multiplier |
getModelScale(ref) | Optional<Float> | Visual size scale |
isHealthFinalized(ref) | boolean | Whether health scaling has been verified |
Progression
| Method | Returns | Description |
|---|---|---|
getSpawnDistance(ref) | Optional<Float> | Distance from world origin at spawn |
getDistanceHealthBonus(ref) | Optional<Float> | Bonus health from distance |
getDistanceDamageBonus(ref) | Optional<Float> | Bonus damage from distance |
Combat
| Method | Returns | Description |
|---|---|---|
isInCombat(ref) | boolean | Whether the mob has an active target |
getLastAggroTarget(ref) | Optional<Ref<EntityStore>> | Current or last aggro target |
getLastAggroTick(ref) | Optional<Long> | Server tick of last aggro event |
Summons
| Method | Returns | Description |
|---|---|---|
getSummonedMinionCount(ref) | Optional<Integer> | Number of active summoned minions |
Abilities
| Method | Returns | Description |
|---|---|---|
getSupportedTriggerTypes() | Set<String> | All registered ability trigger type IDs |
isTriggerTypeSupported(id) | boolean | Whether a specific trigger type is registered |
Query Examples
Check if an entity is an elite and read its tier
Read scaling values for a HUD or tooltip
Check combat state and current target
Read distance-based progression bonuses
Monitor summoned minions
Ability Types
TheAbilityType enum defines the built-in abilities:
| Enum | ID | Description |
|---|---|---|
HEAL_LEAP | "HEAL_LEAP" | Jump to safety and self-heal |
CHARGE_LEAP | "CHARGE_LEAP" | Leap toward target with area damage |
SUMMON_UNDEAD | "SUMMON_UNDEAD" | Spawn undead reinforcements |
Example: Full Integration
Thread Safety
Event callbacks are dispatched from the server’s main tick thread. Do not perform blocking I/O or long-running computations inside event handlers. If you need async processing, queue work to a separate thread and return immediately. The Query API reads component data from the entity store and should only be called from contexts where the store is accessible (event handlers, tick systems, orworld.execute() callbacks).