CloverCard / CloverTrainerUtils

An NPC mod for Pixelmon which adds additional functionality to NPC trainers
Other
3 stars 2 forks source link

CloverTrainerUtils Documentation

Introduction

In Pixelmon Reforged, there are many options for customizing trainers such as battle rules, dialogue, drops, and teams; however, these features by themselves can be very limiting for server owners who may want far more customizability. One common option many take is using the Trainer Commands sidemod to run commands to perform actions during common battle or interaction events; however this only allows them to perform actions that can be done through commands, and nothing more. This mod seeks to expand on that and provide far more customizability using a Pure Forge approach for wider usage.


Features

Instanced Battles (Mandatory): Starting a battle with a trainer starts a battle with an invisible cloned copy of the trainer which deletes itself at the end of the battle. This allows for multiple people to be battling the same trainer at the same time.

Conditional Drops: Allows a server/staff member to add an item OR command with a drop rate (1-100%) to a trainer. This can be done individually in game or defined as a preset group within the configuration files.

Team Shuffling: Allows for a trainer to shuffle teams defined in the mod’s configuration files.

Checkpoints: Prevents someone from fighting a trainer unless they have the defined access tag AND/OR rewards someone an access tag upon beating a trainer. This allows for potential gatekeeping or progression in servers.

Commands: Replicates trainer commands with a more user friendly command structure. (Note: This mod and trainer commands do not mix well together when on the same trainer, hence why this feature is necessary).


Getting Started

*Note: To use this mod, you need both the latest version of Pixelmon Reforged for MC 1.16.5 and at least Minecraft Forge (Version: 36.2.34).

  1. After downloading the mod, place it within your mods folder. (Note: mods folder NOT plugins folder).
  2. Start your server. If everything works fine, your server should start up with no problems, and the default configuration files should generate in the /config/CloverTrainerUtils folder.
  3. Log in to your server and pick an NPC trainer of your choice and run the command, “/tutils init”.
  4. Congratulations! You’ve set up your first trainer for this mod. To see further information on what else you can do, you can use “/tutils about” to see all commands, or further check this documentation.

Commands

Basic

Function Command Description
Initializing Data for the Mod /tutils init Set up a trainer for this mod. Without any other commands, it allows all of their fights to be instanced.
Clearing Mod Data /tutils clear Removes all data associated with CloverTrainerUtils from a trainer, making it a normal trainer once again.
Display Mod Information /tuils about Displays commands and their descriptions within the game chat.

Checkpoints

Function Command Description
Add Checkpoint /tutils checkpoints add [access_tag] [rewarded_tag]: Sets the tag required to access the trainer and the tag rewarded for beating the trainer.
Add Checkpoint (Only reward tag) /tutils checkpoints begin [rewarded_tag] Sets the tag rewarded for beating the trainer and removes any tag required to access the trainer.
Add Checkpoint (Only access tag) /tutils checkpoints finish [access_tag] Sets the tag required to access a trainer and removes any tag rewarded for beating the trainer.
View Checkpoints /tutils checkpoints list Displays the current tags.
Clear Checkpoints /tutils checkpoints clear Removes all tags on a trainer.

Permissions

Function Command Description
Add Permission /tutils permissions add [permission_tag]: Sets the tag required to access the trainer.
Remove a Permission /tutils permissions remove [permission_tag]: Removes a permission from the trainer.
View Permissions /tutils permissions list Displays the current tags.
Clear Permissions /tutils permissions clear Removes all tags on a trainer.

Conditional Drops

Function Command Description
Add Conditional Drop /tutils conddrops add [item OR cmd] [probability (1-100)] [quantity (1 or Greater)] [item id (i.e pixelmon:master_ball) OR command (i.e. say hello)] Adds an item/cmd drop with a conditional drop rate to the trainer.
Add Conditional Drops using a Preset /tutils conddrops addpreset [preset_name] Adds a list of conditional drops defined within the configuration files.
View Conditional Drops /tutils conddrops list Lists a trainer's conditional drops in the order added.
Clear Conditional Drops /tutils conddrops clear Removes all of a trainer's conditional drops.
Remove a Single Conditional Drop /tutils conddrops remove [order_number] Removes a conditional drop currently in the order number's position.

Trainer Commands

Function Command Description
Add Trainer Command /tutils commands add [start OR forfeit OR playerwins OR playerloses OR interact] [command] Performs a command after the specified event happens.
View Trainer Commands /tutils commands list [start OR forfeit OR playerwins OR playerloses OR interact] Lists the commands that are performed after the specified event in order added.
Remove A Trainer Command /tutils commands remove [start OR forfeit OR playerwins OR playerloses OR interact] [order_number] Removes the command at the position of the order number.
Clear Trainer Commands /tutils commands clear [start OR forfeit OR playerwins OR playerloses OR interact] Clears all commands on a trainer for the specified event.
Special Command Placeholders
Player Placeholder @PL Gets the player who this command is based around.
Player Runs Command Placeeholder @PCMD Makes the player run the command rather than the server.
Delay Placeholder @D:# Adds # seconds delay until a command is run.

Team Shuffler

Function Command Description
Add a Team /tutils shuffler add [team_id] Adds a team defined in the config to potentially select at the start of a battle.
Remove a Team /tutils shuffler remove [team_id] Removes the team id provided from the ids a trainer can shuffle through.
Clear Teams /tutils shuffler clear Clears all the teams a trainer can shuffle through.
View Teams /tutils shuffler list Lists all the team ids the trainer can shuffle through.

Configuration

Conditional Drop Presets

The conditional drops configuration file can be found in the /config/CloverTrainerUtils/conddrops folder. Within the json file, multiple different presets can be defined under the map called, “presets”. The name given is what is needed to use when using the preset command. In Example 1, for example, this is “example”

Each preset functions as a list containing multiple drop objects. These drop objects consist of four fields which are type, data, prob, and quantity.

type Can either be item or cmd, which indicate whether the drop is an item or a command.
data When type is item, data is the item’s id such as “pixelmon:master_ball”

When type is cmd, data is the command itself such as “say Hello World!”

prob The probability in percentage of the drop happening. It can only be from 1-100
quantity The amount of the item given or the amount of times the command is run.
Example 1
{
  "presets": {
    "example": [
      {
        "type": "item",
        "data": "pixelmon:great_ball",
        "prob": 100,
        "quantity": 5
      },
      {
        "type": "cmd",
        "data": "say Hello World!",
        "prob": 100,
        "quantity": 1
      }
    ]
  }
}

Team Shuffler

The team shuffler configuration files can be found in the /config/CloverTrainerUtils/shuffler folder. The files consist of two config files. The pokemon.json file is used to define the pokemon that can be used in a team, and the teams.json is used to connect the ids from the pokemon.json with a team id to be used with shuffler commands.

Pokemon Configuration

Within the pokemon.json, all pokemon objects are defined within the “pokemon” map. In Example 2 examples of these pokemon objects are labeled “example1” and “example2”. Each has a variety of fields to create the pokemon.

Field Description
species The species name of the pokemon.
form The form name of the pokemon
gender The gender name of the pokemon
ability The ability name of the pokemon
nature The nature name of the pokemon
heldItem The held item id of the item.
ivs A list of the pokemon’s ivs from 0-31 in the order of Hp, Attack, Defense, Special Attack, Special Defense, and Speed.
evs A list of the pokemon’s ivs from 0-252 in the order of Hp, Attack, Defense, Special Attack, Special Defense, and Speed.
moveset A list of four move names that will make up the pokemon’s moveset.
Example 2
{
  "pokemon": {
    "example2": {
      "species": "Bidoof",
      "form": "",
      "gender": "female",
      "ability": "Moody",
      "nature": "Adamant",
      "heldItem": "pixelmon:leftovers",
      "ivs": [
        31,
        31,
        31,
        31,
        31,
        31
      ],
      "evs": [
        252,
        0,
        0,
        0,
        0,
        252
      ],
      "moveset": [
        "Tackle",
        "Growl",
        "Roar",
        "Sheer Cold"
      ]
    },
    "example1": {
      "species": "Pikachu",
      "form": "",
      "gender": "female",
      "ability": "Moody",
      "nature": "Adamant",
      "heldItem": "pixelmon:leftovers",
      "ivs": [
        31,
        31,
        31,
        31,
        31,
        31
      ],
      "evs": [
        252,
        0,
        0,
        0,
        0,
        252
      ],
      "moveset": [
        "Tackle",
        "Growl",
        "Roar",
        "Sheer Cold"
      ]
    }
  }
}
Teams Configuration

Within the json file, multiple different teams can be defined under the map called, “teams”. The name given is what is needed to use when using the shuffler command. In Example 3, for example, this is “exampleteam”. Within “exampleteam”, up to six slots can be with the contents of each slot being the id of the pokemon object within the pokemon.json file.

Example 3
{
  "teams": {
    "exampleteam": {
      "slot1": "example1",
      "slot2": "example2"
    }
  }
}