Radical Cobblemon Trainers - API
Trainer management and battle API for Cobblemon.
This API was developed as foundation for the Radical Cobblemon Trainers mod and as replacement for the discontinued dependency CobblemonTrainers for Minecraft >= 1.21 and Cobblemon >= 1.6.
Yet it is designed as independent library to provide a subset of similar features for everyone to use.
Key features
- Trainer management and entity association (trainer registry)
- Support for different battle formats (1v1 SINGLE, 1v1 DOUBLE, 2v2 MULTI, ...)
- Custom battle rules (e.g. max item usages per battle)
- Extended AI features (currently only supported by
RCTBattleAI):- Usual battle activities (move selection, switch, ...)
- Gimmicks: Mega evolve, Dynamax, Z-Moves, Terastallize, etc. (most gimmicks that are activated by held items will require another mod to provide them. Mega Showdown would be an example and is also required for dyna- and gmax)
- Trainers can carry and use items
- Trainer and pokemon models (pojos) for easy parsing
- Converters to Cobblemon types
- Model validation (collects all errors before an exception is thrown)
Check out the repository for an example.
Supported By
All Versions
+ Add Version| Name | Game version | Platforms | Published | Downloads | Actions |
|---|---|---|---|---|---|
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 | ||||
| 2d ago | 1 |
## [0.16.1-beta] - 2026-09-14
- Added:**
- #134*
GsonUtil: Static helpers to create preconfigured *GSON* instances
- Changed:**
- #133* Added very basic scripting support to
rctbattle AI. The configuration now has a new property,battleScript, a list of actions to perform in the provided order: - Available actions are:
move:<moveId>(showdown move id, e.g.tackle),switch:<position>(0-5) anditem:<itemId>(showdown item name, e.g.potionorx_attack) - If the
<type>:prefix is ommitted a<moveId>is assumed - Targets are chosen based of the default AI evaluation
- The AI will fallback to its usual behaviour if a scripted action was not possible (e.g. a pokemon does not have the selected move) or all scripted actions have been performed
- There is no validation if an action succeeded (e.g. it is not possible to distinguish if a move hit or not)
- Fixed:**
- #132* Battle softlocks caused by pokemon fainting on both sides
## [0.16.1-beta] - 2026-09-14
- Added:**
- #134*
GsonUtil: Static helpers to create preconfigured *GSON* instances
- Changed:**
- #133* Added very basic scripting support to
rctbattle AI. The configuration now has a new property,battleScript, a list of actions to perform in the provided order: - Available actions are:
move:<moveId>(showdown move id, e.g.tackle),switch:<position>(0-5) anditem:<itemId>(showdown item name, e.g.potionorx_attack) - If the
<type>:prefix is ommitted a<moveId>is assumed - Targets are chosen based of the default AI evaluation
- The AI will fallback to its usual behaviour if a scripted action was not possible (e.g. a pokemon does not have the selected move) or all scripted actions have been performed
- There is no validation if an action succeeded (e.g. it is not possible to distinguish if a move hit or not)
- Fixed:**
- #132* Battle softlocks caused by pokemon fainting on both sides
## [0.16.0-beta] - 2026-09-06
- Changed:**
- #131* Min required Cobblemon version to
1.8
## [0.16.0-beta] - 2026-09-06
- Changed:**
- #131* Min required Cobblemon version to
1.8
As of version
0.15.0-beta, RCTApi may only be redistributed under the terms of the [MCOML License](https://gitlab.com/srcmc/rct/api/-/raw/1.21.1/LICENSE.txt?ref_type=heads).## [0.15.2-beta] - 2026-04-19
- Fixed:**
- #130* Battle error related to oversight in fix *#129* (*multi gimmick usage fix*)
As of version
0.15.0-beta, RCTApi may only be redistributed under the terms of the [MCOML License](https://gitlab.com/srcmc/rct/api/-/raw/1.21.1/LICENSE.txt?ref_type=heads).## [0.15.2-beta] - 2026-04-19
- Fixed:**
- #130* Battle error related to oversight in fix *#129* (*multi gimmick usage fix*)
As of version
0.15.0-beta, RCTApi may only be redistributed under the terms of the [MCOML License](https://gitlab.com/srcmc/rct/api/-/raw/1.21.1/LICENSE.txt?ref_type=heads).## [0.15.1-beta] - 2026-04-17
- Fixed:**
- #129* Trainers attempting to use multiple gimmicks at the same time, that are not permitted to be used together in one battle, if they have more than one pokemon on the field (e.g. mega + mega or zmove + zmove)
As of version
0.15.0-beta, RCTApi may only be redistributed under the terms of the [MCOML License](https://gitlab.com/srcmc/rct/api/-/raw/1.21.1/LICENSE.txt?ref_type=heads).## [0.15.1-beta] - 2026-04-17
- Fixed:**
- #129* Trainers attempting to use multiple gimmicks at the same time, that are not permitted to be used together in one battle, if they have more than one pokemon on the field (e.g. mega + mega or zmove + zmove)
As of version
0.15.0-beta, RCTApi may only be redistributed under the terms of the [MCOML License](https://gitlab.com/srcmc/rct/api/-/raw/1.21.1/LICENSE.txt?ref_type=heads).## [0.15.0-beta] - 2026-03-21
- Added:**
- #128*
BattleInstance: Associates aTrainerNPCwith aPokemonBattleand theLivingEntityit was attached to at the start of that battle - #127*
TrainerNPC#getBattleInstances(): Retrieves a list of all activeBattleInstances the trainer is attending to
- Changed:**
- #126* Adjustments to the battle AI switch evaluation, which makes it less likely for trainers to switch into pokemon with much higher stats
- #125* Slight adjustment to battle AI to lower the chance to use (often waste) healing items on squishy pokemon on the field
- #124* Trainers may now attend to multiple battles at the same time
- Note that a trainer **entity** can still only attend to one battle at a time (a copy of that entity can attend to a different battle)
- The entity the trainer was attached to **at the start of a battle** is stored to ensure recall animations of pokemon will always point towards that entity
- This was possible in an older version of the API (with unexpected side effects) but was never an intended feature, now it is
- #123* Trainers now support custom sound events. Use the
battleThemeproperty to assign a custom resource location (falls back tobattle.pvn.defaultif unset). Refer to [the docs](https://srcmc.gitlab.io/rct/docs/latest/configuration/resource_pack/battle_themes/) for more info
- Fixed:**
- #122* Battle AI attempting to use baton pass when there is no pokemon to switch to and it will also avoid that move if the user has no stat buffs
- #121* Battle AI not including active shield effects (light screen/reflect) in some damage calculations
- #120* Battle AI not recognizing the weather effects "heavy rain", "extremely harsh sunlight" and "strong winds" (e.g. attempting to use fire or water moves when they would fail)
- #119*
BATTLE_STARTEDevent receivingnullinstead of theBattleStateas parameter
- Removed:**
- #118* Deprecated overloads of
TypeChart#getEffectiveness()
As of version
0.15.0-beta, RCTApi may only be redistributed under the terms of the [MCOML License](https://gitlab.com/srcmc/rct/api/-/raw/1.21.1/LICENSE.txt?ref_type=heads).## [0.15.0-beta] - 2026-03-21
- Added:**
- #128*
BattleInstance: Associates aTrainerNPCwith aPokemonBattleand theLivingEntityit was attached to at the start of that battle - #127*
TrainerNPC#getBattleInstances(): Retrieves a list of all activeBattleInstances the trainer is attending to
- Changed:**
- #126* Adjustments to the battle AI switch evaluation, which makes it less likely for trainers to switch into pokemon with much higher stats
- #125* Slight adjustment to battle AI to lower the chance to use (often waste) healing items on squishy pokemon on the field
- #124* Trainers may now attend to multiple battles at the same time
- Note that a trainer **entity** can still only attend to one battle at a time (a copy of that entity can attend to a different battle)
- The entity the trainer was attached to **at the start of a battle** is stored to ensure recall animations of pokemon will always point towards that entity
- This was possible in an older version of the API (with unexpected side effects) but was never an intended feature, now it is
- #123* Trainers now support custom sound events. Use the
battleThemeproperty to assign a custom resource location (falls back tobattle.pvn.defaultif unset). Refer to [the docs](https://srcmc.gitlab.io/rct/docs/latest/configuration/resource_pack/battle_themes/) for more info
- Fixed:**
- #122* Battle AI attempting to use baton pass when there is no pokemon to switch to and it will also avoid that move if the user has no stat buffs
- #121* Battle AI not including active shield effects (light screen/reflect) in some damage calculations
- #120* Battle AI not recognizing the weather effects "heavy rain", "extremely harsh sunlight" and "strong winds" (e.g. attempting to use fire or water moves when they would fail)
- #119*
BATTLE_STARTEDevent receivingnullinstead of theBattleStateas parameter
- Removed:**
- #118* Deprecated overloads of
TypeChart#getEffectiveness()
## [0.14.8-beta] - 2026-02-14
- Fixed:**
- #117* Oversight from previous change leading to trainer pokemon having *random* movesets
## [0.14.8-beta] - 2026-02-14
- Fixed:**
- #117* Oversight from previous change leading to trainer pokemon having *random* movesets
## [0.14.7-beta] - 2026-02-13
- Added:**
- #116*
Debug#setActive(int)static method to configure active debug contexts (not recommended to activate in release builds) - #115*
PokemonPropertiesModelConverter: ConvertPokemonModeltoPokemonProperties(thanks Gito)
- Changed:**
- #114* Adjusted semantics of
Debugutility (now works with *contexts* instead of *levels*, combine with|for multiple)
- Fixed:**
- #113* Battles getting stuck when trainers use Tatsugiris
Commanderability with Dondozo - #112*
PokemonModel(Pokemon)constructor copying wrong properties
## [0.14.7-beta] - 2026-02-13
- Added:**
- #116*
Debug#setActive(int)static method to configure active debug contexts (not recommended to activate in release builds) - #115*
PokemonPropertiesModelConverter: ConvertPokemonModeltoPokemonProperties(thanks Gito)
- Changed:**
- #114* Adjusted semantics of
Debugutility (now works with *contexts* instead of *levels*, combine with|for multiple)
- Fixed:**
- #113* Battles getting stuck when trainers use Tatsugiris
Commanderability with Dondozo - #112*
PokemonModel(Pokemon)constructor copying wrong properties
## [0.14.6-beta] - 2026-01-18
- Added:**
- #111* Added
BattleFormatProvider(functional) interface
- Changed:**
- #110* Changed return type of
BattleState#getFormat()andBattleContext#getFormat()toBattleFormatProvider - #109* The (rctapi)
BattleFormatenum now implementsBattleFormatProvider(method signature remains unchanged) - #108* Updated
BattleRules - Added
adjustNPCLevelsproperty: Decide if npc pokemon levels should be adjusted according to theadjustLevelvalue of the battle format (the default battle formats do not adjust levels) - Added
adjustPlayerLevelsproperty: Decide if player pokemon levels should be adjusted according to theadjustLevelvalue of the battle format (the default battle formats do not adjust levels) - Added
healPlayersproperty: Decide if player pokemon should be healed at the start of a battle - #107*
BattleManager#startBattle(...)(and overloads) now accept aBattleFormatProviderinstead of a (rctapi)BattleFormatas argument (old overloads still exist but are *deprecated*) - #106*
BattleStateandBattleContextnow accept aBattleFormatProviderin their constructors instead of a (rctapi)BattleFormat(old overloads still exist but are *deprecated*)
- Fixed:**
- #105* Certain max moves of dynamaxed pokemon possibly causing battles to softlock
- #104* Tera type
stellarleading to battle failures if evaluated defensively on the player side
## [0.14.6-beta] - 2026-01-18
- Added:**
- #111* Added
BattleFormatProvider(functional) interface
- Changed:**
- #110* Changed return type of
BattleState#getFormat()andBattleContext#getFormat()toBattleFormatProvider - #109* The (rctapi)
BattleFormatenum now implementsBattleFormatProvider(method signature remains unchanged) - #108* Updated
BattleRules - Added
adjustNPCLevelsproperty: Decide if npc pokemon levels should be adjusted according to theadjustLevelvalue of the battle format (the default battle formats do not adjust levels) - Added
adjustPlayerLevelsproperty: Decide if player pokemon levels should be adjusted according to theadjustLevelvalue of the battle format (the default battle formats do not adjust levels) - Added
healPlayersproperty: Decide if player pokemon should be healed at the start of a battle - #107*
BattleManager#startBattle(...)(and overloads) now accept aBattleFormatProviderinstead of a (rctapi)BattleFormatas argument (old overloads still exist but are *deprecated*) - #106*
BattleStateandBattleContextnow accept aBattleFormatProviderin their constructors instead of a (rctapi)BattleFormat(old overloads still exist but are *deprecated*)
- Fixed:**
- #105* Certain max moves of dynamaxed pokemon possibly causing battles to softlock
- #104* Tera type
stellarleading to battle failures if evaluated defensively on the player side
## [0.14.5-beta] - 2025-12-27
- Added:**
- #103* Added
BattleState#isPaticipating(Trainer): Reports if trainer is participating in the associated battle
- Changed:**
- #102* Adjusted priority for gimmicks dynamax/gmax and tera (tera will now be chosen after the max transformation has ended if both are possible)
- #101* Changed default
RCTBattleAIConfig#switchBiasto0.5(value is now a bit more impactful, other biases will most likely get reworked in a similar manner) - #100* Improved evaluation for a bunch of moves with certain requirements (e.g.
Ally SwitchorTrick) and other minor adjustments to move selection logic - #99* Increased priority of some mixins (to avoid potential conflicts)
- #98* Reworked rct battle ai switch evaluation (might require some fine tuning)
- Fixed:**
- #97* Battle AI attempting to use
First Impressionin arbitrary turns (should only be used in first turn) - #96* Battle AI not avoiding sacrificial moves (e.g.
Explosion) when on their last pokemon - #95* Battle AI treating the user of the move
Blockas trapped, rather than the target - #94* Duplicate error messages when failing to start a battle
- #93*
gimmicksproperty of pokemon (tera, dynamax, gmax) not getting applied in battle
## [0.14.5-beta] - 2025-12-27
- Added:**
- #103* Added
BattleState#isPaticipating(Trainer): Reports if trainer is participating in the associated battle
- Changed:**
- #102* Adjusted priority for gimmicks dynamax/gmax and tera (tera will now be chosen after the max transformation has ended if both are possible)
- #101* Changed default
RCTBattleAIConfig#switchBiasto0.5(value is now a bit more impactful, other biases will most likely get reworked in a similar manner) - #100* Improved evaluation for a bunch of moves with certain requirements (e.g.
Ally SwitchorTrick) and other minor adjustments to move selection logic - #99* Increased priority of some mixins (to avoid potential conflicts)
- #98* Reworked rct battle ai switch evaluation (might require some fine tuning)
- Fixed:**
- #97* Battle AI attempting to use
First Impressionin arbitrary turns (should only be used in first turn) - #96* Battle AI not avoiding sacrificial moves (e.g.
Explosion) when on their last pokemon - #95* Battle AI treating the user of the move
Blockas trapped, rather than the target - #94* Duplicate error messages when failing to start a battle
- #93*
gimmicksproperty of pokemon (tera, dynamax, gmax) not getting applied in battle
## [0.14.4-beta] - 2025-12-11
- Fixed:**
- #92* Workaround to avoid issue with the Cobblemon showdown interpreter leading to battle instructions getting executed in the wrong order (most commonly triggered by switched-in trainer pokemon getting immediately knocked out). This changes is restricted to battles started by rctapi.
- Removed:**
- #91* Adhoc fix for issues related to pokemon switching positions (e.g. with "Ally Switch") as it has been fixed recently in Cobblemon itself
## [0.14.4-beta] - 2025-12-11
- Fixed:**
- #92* Workaround to avoid issue with the Cobblemon showdown interpreter leading to battle instructions getting executed in the wrong order (most commonly triggered by switched-in trainer pokemon getting immediately knocked out). This changes is restricted to battles started by rctapi.
- Removed:**
- #91* Adhoc fix for issues related to pokemon switching positions (e.g. with "Ally Switch") as it has been fixed recently in Cobblemon itself
## [0.14.3-beta] - 2025-12-05
- Fixed:**
- #90* Battles tending to get softlocked when AI switches
## [0.14.3-beta] - 2025-12-05
- Fixed:**
- #90* Battles tending to get softlocked when AI switches
## [0.14.2-beta] - 2025-12-04
- Fixed:**
- #89* Different scenarios leading to battles getting softlocked
## [0.14.2-beta] - 2025-12-04
- Fixed:**
- #89* Different scenarios leading to battles getting softlocked
## [0.14.1-beta] - 2025-11-24
- Changed:**
- #88* Replaced
Pokemon#clone()invocations withPokemon#copyFrom()(this might have been the cause for some battle related issues)
## [0.14.1-beta] - 2025-11-24
- Changed:**
- #88* Replaced
Pokemon#clone()invocations withPokemon#copyFrom()(this might have been the cause for some battle related issues)
## [0.14.0-beta] - 2025-11-22
- Changed:**
- #87* Increased minimum required version of Cobblemon to
1.7 - #86* Replaced some log errors with warnings
## [0.14.0-beta] - 2025-11-22
- Changed:**
- #87* Increased minimum required version of Cobblemon to
1.7 - #86* Replaced some log errors with warnings
## [0.13.9-beta] - 2025-09-26
- Fixed:**
- #85* Conflict with *Cobblemon UI Tweaks*
## [0.13.9-beta] - 2025-09-26
- Fixed:**
- #85* Conflict with *Cobblemon UI Tweaks*
