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.
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>... [<battleRules>]
: Starts a battle between the given participants with the specified battle format and battleRules.
All commands require a permission level of
2
.
Easy NPC Example
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, and battleFormat
, which is a command argument). 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 trainersbug_catcher
andash_ketchum
. - Loading
Boring World
: This will only register the trainerbug_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.
Configuration
The config file is located at config/tbcs-server.toml
:
#List of paths, relative to the world directory, to
#search for trainer json files when loading a world.
#
#Default: ["trainers", "../trainers", "../../trainers"]
trainerPaths = ["trainers", "../trainers", "../../trainers"]
Dependencies
- Cobblemon
- Radical Cobblemon Trainers API
- Forge Config API Port (only on fabric)
Supported By
License
The source code of this project is licensed under GNU-LGPL.
90% of ad revenue goes to creators
Support creators and Modrinth ad-free with Modrinth+