Configuration - navneetset/pebbles-flexible-commands GitHub Wiki
The Flexible Commands Mod uses JSON files for configuration, making it easy for server admins to create and manage dynamic commands and info commands.
For quick configuration, feel free to use my WebEditor!
Commands are stored in config/pebbles-flexible-commands
. Each command is defined in its own JSON file. Below is the structure and example for creating commands.
Field | Description |
---|---|
alias |
The main alias for the command. |
baseCommand |
The base command to execute. |
permission |
The permission required to use the command. |
runAs |
Specifies if the command runs as the player (player ) or console (console ). |
template |
The template string for the command. {} placeholders are replaced dynamically. Supports {executor} to refer to the player executing the command. |
arguments |
List of arguments for the command. |
customLogic |
Map of keys to custom logic definitions (optional). |
Field | Description |
---|---|
name |
The name of the argument (e.g., player ). |
type |
The type of the argument (string , player , choice , int ). |
choices |
List of choices for choice type arguments (optional). |
{
"alias": "givepoke",
"baseCommand": "pokegiveother",
"permission": "flexiblecommands.command.givepoke",
"runAs": "console",
"template": "{baseCommand} {player} {pokemon} shiny={shiny} galarian={galarian} speed_iv={custom:ivs:0} attack_iv={custom:ivs:1}",
"arguments": [
{ "name": "player", "type": "player" },
{ "name": "pokemon", "type": "string" },
{ "name": "shiny", "type": "choice", "choices": ["true", "false"] },
{ "name": "galarian", "type": "choice", "choices": ["true", "false"] }
],
"customLogic": {
"ivs": {
"type": "guaranteedMaxIvs",
"params": {
"numMaxIvs": 2,
"maxValue": 31,
"randomRange": [0, 31]
}
}
}
}
{
"alias": "giverandomdiamonds",
"baseCommand": "give",
"permission": "flexiblecommands.command.giverandomdiamonds",
"runAs": "console",
"template": "{baseCommand} {player} minecraft:diamond {custom:randomamount}",
"arguments": [
{ "name": "player", "type": "player" }
],
"customLogic": {
"randomamount": {
"type": "randomnumberrange",
"params": {
"min": 1,
"max": 64
}
}
}
}
Info commands are simple text commands that display a predefined message. These are stored in config/pebbles-flexible-commands/info-commands
.
Field | Description |
---|---|
aliases |
List of aliases for the info command. |
permission |
Permission required to use the command. |
message |
The message displayed when the command is executed. |
{
"aliases": ["discord", "discordlink", "dc", "disc"],
"permission": "flexiblecommands.command.discord",
"message": "<green>Join our [<yellow><click:open_url:'https://discord.gg/kzpyuB57Gu'>Discord</click></yellow>] server!"
}
Custom logic dynamically generates data for commands based on logic types and parameters.
Ensures that a specified number of IVs have their maximum value, while others are randomized.
-
Parameters:
-
numMaxIvs
: Number of IVs to set to max (default:3
). -
maxValue
: Maximum IV value (default:31
). -
randomRange
: Range for random IVs (default:[0, 31]
).
-
-
Template Example: { "template": "{baseCommand} {player} {pokemon} attack_iv={custom:ivs:0} speed_iv={custom:ivs:1}" }
Generates a random number within a specified range.
-
Parameters:
-
min
: Minimum value. -
max
: Maximum value.
-
-
Template Example: { "template": "{baseCommand} {player} minecraft:diamond {custom:randomamount}" }
Selects a random online player.
- Template Example: { "template": "{baseCommand} {custom:randomplayer} minecraft:diamond 10" }
Selects a random string from a predefined list.
-
Parameters:
-
list
: A list of strings.
-
-
Template Example: { "template": "{baseCommand} {player} {custom:randompokemon}" }
A: You can use {executor} placeholder for it.
A: Create a new JSON file in the respective folder (alias-commands
or info-commands
). Use the provided examples as templates.