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 or minion dies | No | isMinion() |
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 | getTargetRef() |
RPGMobsDeaggroEvent | Elite loses its target | No | - |
RPGMobsScalingAppliedEvent | Scaling parameters computed | No | getHealthMultiplier(), getDamageMultiplier(), getModelScale() |
RPGMobsReconcileEvent | Config reconciliation pass | No | getWorldName(), getEntityCount() |
Base Event Fields
Every event extendsRPGMobsEvent which provides:
getWorld()- theWorldin which the event occurred (since 1.1.0)getEntityRef()- the RPG mob’sRef<EntityStore>getEntityUuid()- the entity’sUUID, ornullif unavailable (since 1.1.0)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 |
isMinion(ref) | boolean | Whether the entity is a summoned minion |
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 |
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
Inspect combat state (since 1.2.0)
Filter minion deaths
Ability IDs
Abilities are identified by string IDs passed in ability events (RPGMobsAbilityStartedEvent, RPGMobsAbilityCompletedEvent, RPGMobsAbilityInterruptedEvent). The built-in ability IDs are:
| ID | Description |
|---|---|
"charge_leap" | Leap toward target with area slam damage |
"heal_leap" | Jump to safety and drink a healing potion |
"undead_summon" | Spawn role-based reinforcements |
"dodge_roll" | Reactive/preemptive lateral dodge with invulnerability frames |
"multi_slash_short" | 1-2 hit quick strikes (3 random variations per weapon type) |
"multi_slash_medium" | 2-4 hit combos (2 random variations per weapon type) |
"multi_slash_long" | 4-6 hit full combos (1 variation per weapon type) |
"enrage" | Berserk fist-fighting mode ending in exhaustion death |
"volley" | Ranged projectile burst for bow/crossbow/gun wielders |
Example: Full Integration
Spawn API (since 1.3.0)
The Spawn API lets other mods programmatically create RPGMobs elites. Access it viaRPGMobsAPI.spawn().
Quick Reference
| Method | Description |
|---|---|
RPGMobsAPI.spawn().spawnElite(world, roleName, tier, position, rotation, weaponCategory) | Creates an NPC and promotes it to an elite in one call |
RPGMobsAPI.spawn().applyEliteTier(world, npcRef, tier, weaponCategory) | Promotes an already-spawned NPC to an elite |
| Parameter | Type | Description |
|---|---|---|
world | World | The world to spawn in |
roleName | String | NPC role name (e.g. "Skeleton_Fighter", "Trork_Warrior", "Goblin_Duke") |
tier | int | Tier number 1-5 (clamped if out of range). 1 = Common, 5 = Legendary |
position | Vector3d | Spawn position in world coordinates |
rotation | @Nullable Vector3f | Spawn rotation, or null for default |
weaponCategory | @Nullable String | Weapon category override (see table below), or null to use the mob rule’s default |
npcRef | Ref<EntityStore> | (applyEliteTier only) Reference to an existing NPC entity |
Weapon Categories
Pass one of these exact strings asweaponCategory to force the elite to spawn with that weapon type. Pass null to let RPGMobs pick based on the mob rule’s configured categories.
| Category | Type | Example weapons |
|---|---|---|
"Swords" | Melee | Iron Sword, Steel Sword |
"Longswords" | Melee | Steel Longsword, Adamantite Longsword |
"Daggers" | Melee | Iron Daggers, Bone Daggers |
"Axes" | Melee | Iron Axe, Steel Axe |
"Battleaxes" | Melee | Iron Battleaxe, Adamantite Battleaxe |
"Maces" | Melee | Iron Mace, Steel Mace |
"Clubs" | Melee | Wooden Club, Bone Club |
"ClubsFlail" | Melee | Flail variants |
"Spears" | Melee | Iron Spear, Steel Spear |
"Pickaxes" | Melee | Iron Pickaxe, Steel Pickaxe |
"Shortbows" | Ranged | Shortbow variants (uses vanilla ranged AI) |
"Crossbows" | Ranged | Crossbow variants (uses vanilla ranged AI) |
"Guns" | Ranged | Gun variants (uses vanilla ranged AI) |
"Staves" | Ranged | Staff variants (uses vanilla ranged AI) |
"Spellbooks" | Ranged | Spellbook variants (uses vanilla ranged AI) |
Spawn a New Elite
Elite-ify an Existing NPC
If you already spawned an NPC viaNPCPlugin and want to promote it:
Force a Weapon Category
Handle Failures
SpawnResult is a sealed interface. Check success or match on the failure reason:
Threading
All spawn methods must be called on the world’s thread. From other threads, wrap inworld.execute():
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).