Download Melius Commands — Minecraft Mods — MetaMods

Melius Commands

Active

Downloads

0

Last update

1 month ago

Versions

1.20 — 1.21.9
Server
Fabric
Quilt
Libraries
Control
Utils

Melius Commands

Melius Commands

This Fabric server-side mod provides the ability to create custom commands and modify existing game commands.

Creating Custom Commands

To add your own commands, create a JSON file in the ./config/melius-commands/commands directory. Example configuration files are available on the project page. After making changes, execute the /reload command in the game to apply the settings.

JSON File Structure

The file format supports comments for convenience during configuration (do not copy the // symbols into your configuration files).

Command Element (Literal or Argument)

To simplify creating custom commands, it's recommended to use the online generator, which ensures syntax correctness.

The root element must always be a literal node.


{
  "id": "...",
  // Command identifier (command name for literal nodes) (required)
  "type": "...",
  // Argument type, see below. (argument nodes only, required)
  "executes": [
    // List of command executions, see below.
  ],
  "require": {
    // Condition checking for command access
  },
  "literals": [
    // List of child literal nodes
  ],
  "arguments": [
    // List of child argument nodes
  ],
  "redirect": "..."
  // If specified, the command will copy execution, requirements and child elements from the specified node.
  // This allows creating an alias for another command
}

Command Execution

It can be represented as a simple string, which will be executed silently, as console with privilege level 4, or can be configured manually:


{
  "command": "...",
  // Command to execute (can reference argument values via ${id})
  "silent": false,
  // Disable command output, if set to true
  "as_console": false,
  // Whether to execute the command as console
  "op_level": 4
  // Operator level of command source (optional) (possible values: 0 - 4)
}

Most importantly - the command value can use placeholders from command arguments and global placeholders using the format ${PLACEHOLDER}, where PLACEHOLDER can be either an argument identifier or a global placeholder, for example, values from other plugins.

Argument Types

The complete list of all argument types is available in the corresponding Minecraft Wiki section. Some argument types require additional parameters, which must be added separated by spaces.

Command Modifiers

To add command requirements, create a JSON file in the ./config/melius-commands/modifiers directory.

JSON File Structure

Use the online generator for quick and easy creation of command modifiers with guaranteed syntax correctness.

Command Modifier

Key feature: there are two types of command matchers:

  • Node matchers match command nodes (the structure used by Brigadier to represent commands internally) by their path (for example, teleport.location matches commands like /teleport 0 100 0)
  • Command matchers match the string used during command execution (for example, warp end matches /warp end)

Determining Command Node Paths

Use the /melius-commands path <cmd> command to determine command node paths for any command. For example, to check the path of the /tp DrexHD 0 100 0 command, enter /melius-commands path tp DrexHD 0 100 0 and receive teleport.targets.location, which can be used in command modifiers.

Placeholders

  • %melius-commands:cooldown [id]% / %melius-commands:cooldown [id] [formatting]% - Tracking player command cooldowns.
    • [id] - identifier specified in the cooldown modifier.
    • [formatting] - duration execution formatting.
Project members
DrexHD

DrexHD

Developer

Created: 17 Aug 2023

ID: 10746