This mod allows you to create custom commands.
A fabric server side mod to create custom, and modify existing commands
To add custom commands, create a json file in ./config/melius-commands/commands.
For example files, see examples/commands! Apply your changes, by running /reload in-game.
Json format includes comments for clarification (don't copy // in your files)
Check out the online generator to create your custom commands
quick and easy! This will also make sure your syntax is valid.
The root node must always be a literal node.
{
"id": "...",
// Command id (command name for literal command nodes) (required)
"type": "...",
// Argument type, see below. (argument node only, required)
"executes": [
// A list of command node executions, see below.
],
"require": {
// See https://github.com/Patbox/PredicateAPI/ for further information.
// If this evaluates to true for a Command Source, it will have access to this command node!
},
"literals": [
// A list of literal children nodes
],
"arguments": [
// A list of argument children nodes
],
"redirect": "..."
// If specified the command will copy execution, requirements and children from the specified node.
// This can effectively create an alias for another command
}
This can either be a simple string, which will be executed silent, as console with op level 4 or manually configured
like this:
{
"command": "...",
// The command that will be executed (can reference argument values, with ${id})
"silent": false,
// Disable command output if set to true
"as_console": false,
// Whether this command should be executed as console command source
"op_level": 4
// The operator level of the command source (optional) (Possible values: 0 - 4)
}
The command execution value can use placeholders from command arguments and
global placeholders, by using this format ${PLACEHOLDER}, where PLACEHOLDER
can either be the argument id, or a global placeholder
like player:name.
For a full list of all argument types refer to the Argument types wiki.
Some argument types require additional arguments, which must be appended seperated by spaces.
To add command requirements, create a json file in ./config/melius-commands/modifiers.
For example files, see examples/modifiers!
Check out the online generator to create your custom command
modifiers quick and easy! This will also make sure your syntax is valid.
Json format includes comments for clarification (don't copy // in your files)
The syntax depends on the modifier type you choose. The most important thing to note is that there are two types of
command matchers:
teleport.location, will match any command like this /teleport 0 100 0)warp end will/warp end)Both of these types come with three different flavours:
strict modifiers will only be applied to that exact node / that exact command inputstarts_with modifiers will be applied to the specified node / command and anything that is "longer" than itregex modifiers will be applied to everything matching the regular expressionNode matchers have an extra field called requirement_modifier, which allows you to modify the requirement of the node,
which will completely remove the command from players / command sources that don't meet the requirement!
You can use /melius-commands path <cmd> command to determine command node paths of any command.
Example: to check the path of /tp DrexHD 0 100 0 (teleporting an entity to a block location) you type/melius-commands path tp DrexHD 0 100 0 and will receive teleport.targets.location, which you can use in command
modifiers.
%melius-commands:cooldown [id]% / %melius-commands:cooldown [id] [formatting]% - Player command cooldowns.[id] is the id specified in the cooldown modifier.[formatting] is the duration formatting,