Logo
MINECRAFTBIBLE
Items
Items

All game items

Blocks
Blocks

Building blocks

Mobs
Mobs

Creatures & monsters

Biomes
Biomes

World biomes

Structures
Structures

Generated structures

Recipes
Recipes

Crafting guides

Advancements
Advancements

Achievements

Loot Tables
Loot Tables

Drop rates

Tags
Tags

Item groupings

All Versions
View all data →
Capes
Cape ArchiveNEW

Browse rare Minecon capes, OptiFine capes, and custom capes from players worldwide

Browse

Player Database
Player DatabasePopular

Search any player

Skin Browser
Skin Browser

Browse & download skins

Cape Gallery
Cape GalleryNEW

Minecon & OptiFine capes

Seed Vault
Seed Vault

Curated seeds

Learn

Guides
GuidesNew

Tutorials & tips

Blog
Blog

News & updates

Community

Community Hub
Community HubHub

Posts, discussions & more

All Versions
View community →
Seed Analyzer
Seed Analyzer

World seed analysis

Loot Explorer
Loot Explorer

Drop rates

Crafting Calculator
Crafting Calculator

Material planning

Enchant Calculator
Enchant Calculator

Probability math

Redstone Lab
Redstone Lab

Signal timing

Trading Profit
Trading Profit

Villager ROI

All Versions
View all tools →
Mods
Mods

Browse all mods

Plugins
Plugins

Server plugins

Resource Packs
Resource Packs

Textures & sounds

Shaders
Shaders

Visual enhancements

Datapacks
Datapacks

World logic

Scanner
Mod Intelligence

Scan & analyze any mod

All Versions
View all mods →
Loading...
IntroductionIntroductionVersion HistoryVersion HistoryGuidesGuidesBlog & NewsBlog & News
ItemsItemsBlocksBlocksMobsMobsRecipesRecipesBiomesBiomesStructuresStructuresAdvancementsAdvancementsLoot TablesLoot TablesTagsTags
ModsModsPluginsPluginsResource PacksResource PacksShadersShadersDatapacksDatapacks

MinecraftBible

The Ultimate Wiki

Logo
MINECRAFTBIBLE

The ultimate Minecraft reference. Every item, block, mob, and recipe documented with precision.

Community

  • Skin Browser
  • Cape Gallery
  • Seed Vault
  • Blog
  • Guides

Database

  • Items
  • Blocks
  • Mobs
  • Recipes
  • Biomes
  • Structures

Tools

  • Seed Analyzer
  • Mod Intelligence
  • Crafting Calculator
  • Enchant Calculator

Mods & Packs

  • Mods
  • Plugins
  • Resource Packs
  • Shaders
  • Datapacks

Site & Legal

  • About
  • Authors
  • Editorial Policy
  • Corrections
  • Contact
  • Privacy Policy
  • Terms of Service
  • DMCA
  • Sitemap

© 2026 MinecraftBible. Not affiliated with Mojang or Microsoft.

PrivacyTermsContact
Cobblemon Trainer Battle Commands
ModLGPL-3.0-or-later

Cobblemon Trainer Battle Commands

Provides commands to manage trainers and start battles that can act as an interface for other mods (e.g. Easy NPC).

104.4K
Downloads
24
Followers
7 months ago
Updated
📦
18
Versions
game-mechanicsmanagementmobsfabricneoforge
Download Latestv0.13.0-betaView on Modrinth

📖About Cobblemon Trainer Battle Commands

Cobblemon Trainer Battle Commands (TBCS)

Provides commands to manage trainers and start battles that can act as interface for other mods (e.g. Easy NPC).

This mod is mostly intended for map makers and modpack developers.

Supported By

bisecthosting

Commands

  • tbcs
    • attach <trainerId> <entity>: Attaches the given trainer to the specified entity (a trainer will only ever be attached to one entity).
    • battle <battleFormat> <participants1>... vs <participants2>... [rules <battleRules>] [onwin <winCommands>]: Starts a battle between the given participants with the specified battle format, rules and win commands (the latter two are optional).

All commands require a permission level of 2.

Battle Rules

Battle rules are described by a json object with following properties:

  • maxItemUses: Specifies how many items each participant may use in a battle.

Yes, it is currently only this one property.

Win Commands

Win commands are also described by a json object but with a little bit more dynamic structure. A win command object may define a property for each battle side (i.e. 1 or 2), containing an array of commands to execute if the respective side wins (see examples below).

In addition any win command has access to special selectors (similar to @s or @e) that allow to select any battle participant within the command. These selectors are structured as follows: @<n> with <n> specifying a position of the battle participants, relative to the side the win command is executed for.

When talking about commands some important questions to ask are: Who is executing the command? And where is it executed?

Win commands are usually executed by the server in the center of all participants from a battle. Although it is possible to have any participant of a battle become the executor of a command, in which case that command is also executed at the position of that participant.

Now, with the formal description out of the way lets get to...

Examples

Important: The trainers used in the following commands (e.g. tbcs:mytrainer1) are just an example. You have to provide your own trainers or install another mod that provides any (see Trainers section below).


tbcs attach tbcs:mytrainer1 @e[type=minecraft:villager,limit=1,sort=nearest]

Attaches tbcs:mytrainer1 to the closest villager.


tbcs battle GEN_9_SINGLES @s vs tbcs:mytrainer1

Starts a battle between the player executing the command and tbcs:mytrainer1 (must be attached to an entity).


tbcs battle GEN_9_SINGLES @s vs tbcs:mytrainer1 rules {maxItemUses: 1}

Like above but limits the item usage of each side to 1.


tbcs battle GEN_9_SINGLES @s vs tbcs:mytrainer1 rules {maxItemUses: 1} onwin {1: ['give @1 minecraft:diamond']}

Another one of these but this time the player is granted a diamond on win (first participant of the first side).


tbcs battle GEN_9_SINGLES @s vs tbcs:mytrainer1 onwin {1: ['loot spawn ~ ~ ~ loot minecraft:chests/simple_dungeon']}

An alternative to using give (often with quite a few more rewards but it depends on the loot table). The win command will be executed by the server in the center of all battle participants. To execute the command as the player (i.e. to spawn the loot directly on top of them) one could precede the loot command with @1 (see also example below).


tbcs battle GEN_9_MULTI @s tbcs:mytrainer1 vs tbcs:mytrainer2 tbcs:mytrainer3 onwin {1: ['give @1 minecraft:diamond', '@2 say We got them!']}

An example for positional selectors. The player will receive a diamond and tbcs:mytrainer1 will say "We got them!" when the first side wins (i.e. player side). This also shows how a command can be executed from a different source other than the server (the second command will be executed by the entity that tbcs:mytrainer1 is attached to).


tbcs battle GEN_9_MULTI @s tbcs:mytrainer1 vs tbcs:mytrainer2 tbcs:mytrainer3 onwin {1: ['give @1 minecraft:diamond', '@2 say We got them!'], 2: ['@3 tp ~ ~10 ~']}

We can extend the previous example by adding win commands for the other side, i.e. these are executed if the player side loses. As a reminder, the positional arguments are relative to the side of the win command and go from left to right. So for commands executed from the second side the selectors are mapped as the following:

  • @1 -> tbcs:mytrainer2
  • @2 -> tbcs:mytrainer3
  • @3 -> @s
  • @4 -> tbcs:mytrainer1

For reference commands executed from the first side will map the selectors like this:

  • @1 -> @s
  • @2 -> tbcs:mytrainer1
  • @3 -> tbcs:mytrainer2
  • @4 -> tbcs:mytrainer3

So the win command of the second side will punish the player when their side loses (i.e. the second side wins) by teleporting the player 10 blocks up relative from their position (the command is executed by the player).


tbcs battle GEN_9_SINGLES @s vs tbcs:mytrainer1 onwin {1: ['@2 say Not bad, but are you ready for this?!', 'tbcs attach tbcs:mytrainer2 @2', 'tbcs battle GEN_9_SINGLES @1 vs tbcs:mytrainer2 onwin {1: [\'give @1 minecraft:diamond\']}']}

This one chains one battle after another. Lets break it down (all of these are executed when the player wins):

  • the first command will cause the trainer entity of tbcs::mytrainer1 to say "Not bad, but are you ready for this?!"
  • the second command attaches another trainer, tbcs:mytrainer2, to the same entity that tbcs:mytrainer1 is attached to
  • the third command starts another battle between the player and tbcs:mytrainer2 immediately afterwards. This battle also comes with its own definition for win commands rewarding the player with a diamond on win.

See the command in action:

Battle Chain Demo

This could be repeated indefinetely. Note that the further nested a win command is the more backslashes (\) are required to escape the apostrophes (') surrounding the command.


tbcs battle GEN_9_SINGLES @s vs tbcs:mytrainer1 onwin {2: ['@1 say You need to practice more @2!'], 1: ['@2 say You got me. Take this @1', 'loot spawn ~ ~ ~ loot minecraft:chests/end_city_treasure']}

There is nothing new here. It's a command from one of my tests.

Easy NPC Example

Easy NPC Demo

Note: The video is from an older version, trainer ids are now structured a little bit different (see suggestions of the commands ingame) but the functionality is the same. You can find the full video on the repository.

Trainers

Structure

Trainers can be defined using json, the trainer schema is provided by RCTApi hence the structure is mostly the same as from my other mod Radical Cobblemon Trainers (the only exceptions are identity, which does not exist in this mod as well as battleFormat and battleRules, which are both command arguments). You can find more information and an example in the corresponding documentation.

Location

Whenever a world is loaded trainer files will be searched in all trainerPaths, a list of paths relative to the world directory. All trainers will be registered with an id that will be derived from their file name. For example, lets assmume we have a minecraft installation like this (shortened):

mods
config
trainers
  bug_catcher.json
saves
  My Cool World
    Strong Trainers
      Ash Ketchum.json
  Boring World
...

With trainerPaths being defined as: ["Strong Trainers", "../../trainers"].

  • Loading My Cool World: This will register the trainers tbcs:bug_catcher and tbcs:ash_ketchum.
  • Loading Boring World: This will only register the trainer tbcs:bug_catcher.

If a trainer with the same id (i.e. different folders but same file name) will be registered multiple times any subsequent trainers will have a counter (_n) appended to their id.

Compat

The mod is compatible with other mods that also rely on RCTApi. Copies of trainers from these mods may automatically be registered to tbcs when these mods are also installed (see config).

  • Radical Cobblemon Trainers

Configuration

The config file is located at config/tbcs-server.toml:

[Trainers]
  #━━━━━━━━━━
  #List of paths, relative to the world directory, to search for trainer
  #json files when (re)loading a world.
  #
  #Default: ["trainers", "../trainers", "../../trainers"]
  trainerPaths = ["trainers", "../trainers", "../../trainers"]
  #━━━━━━━━━━
  #List of mod ids from mods that also rely on RCTApi to define trainers.
  #Copies of trainers from the listed mods will also be registered to TBCS.
  #
  #Default: ["rctmod"]
  trainerMods = ["rctmod"]

[Commands]
  #━━━━━━━━━━
  #Permission level of win commands.
  #
  #Default: 2
  #Range: 1 ~ 4
  winCommandsPermission = 2

Dependencies

  • Cobblemon
  • Radical Cobblemon Trainers API
  • Forge Config API Port (only on fabric)

License

The source code of this project is licensed under GNU-LGPL.

👥 Team & Contributors

hd42
hd42Owner

⚙️ Compatibility

Environment
✅ Client & Server
Loaders
fabricneoforge
Minecraft Versions
1.21.1

🔗 Links

Modrinth Page