About Cobblemon Trainer Battle Commands
From ModrinthProvides commands to manage trainers and start battles that can act as an interface for other mods (e.g. Easy NPC).
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
Commands
tbcsattach <trainerId> <entity>: Attaches the given trainer to the specified entity (a trainer will only ever be attached to one entity). The attachament does not persist on server restart.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).reload <trainerId>: Allows to reload a single trainer from any of the configured trainer paths (use the vanilla/reloadcommand to reload all trainers).
Important: Since version 0.14.0-beta, the attach command remains functional, but using the as <trainerId> argument is generally advised (see Participants for details).
> All commands require a permission level of 2.
Participants
The battle command supports multiple argument types to specify battle participants. These include single entity selectors (like @s, @e[...,limit=1] or @p), entity UUIDs and trainer ids.
In addition the optional argument as <trainerId> can be used to immediately attach a trainer to a selected entity on battle start:
- This argument can follow any entity selector and allows to specify the id of a trainer that should be attached to the entity at the start of the battle
- Using this argument is equivalent to invoking
attachfor the targeted entity, and makes an explicit invocation ofattachobsolete (whileattach+battlestill works usingbattle ... <entity> as <trainerId>is generally adviced) - When used with a player selector (e.g.
@s as <trainerId>) the player will enter the battle with a temporary copy of that trainers team (enjoy setting up puzzles) - When used with another trainer id (e.g.
<trainerId_1> as <trainerId_2>) thentrainerId_2will be attached to the same entitytrainerId_1is currently attached to (if possible)
> The argument as <traineId> is available since version 0.14.0-beta.
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 ~']}
Highlights
From source dataGame versions
Built for Minecraft 1.21.1.
Loaders
Runs on Fabric and NeoForge.
Footprint
Rated a light load on a server.
What kind of mod it is
From the catalogCreatures & NPCs
Adds or changes creatures, NPCs and how they behave.
Runs on your server
From source side supportModrinth lists Cobblemon Trainer Battle Commands as required on the server. Check its Modrinth page to see whether players need it too.
Compatibility
- Game
- Minecraft
- Loaders
- FabricNeoForge
- Runs on
- Serverrequired on the server
- Game versions
- 1.21.1
Verified at the source
- ✓ModrinthOfficial listing, checked 2026-10-01Open ↗
- ✓Authorhd42, as published on Modrinth
- ✓LicenseLicenseRef-MCOMLFree










