Defined Commands

Defined Commands let you create powerful functionality with no code.

Defined Commands are custom made commands, defined in Oxygen's config, that players can run (if they have the correct permission).

You could use this to add things like aliases (create a simple command that runs a different, or multiple, commands), add extra messaging to existing commands, or for simple QoL like adding commands to teleport people directly to different servers.

This was created so people on Roanoke could do /skyblock to move to our Skyblock shard.

Defined Commands are placed in /config/Oxygen/DefinedCommands/<command>.json

This does replace EEssential's text-command system, but we've left that in so your existing commands keep working.

Here's the example skyblock command:

{
  "command": "skyblock",
  "aliases": ["is"],
  "actions": [
    {
      "type": "SEND-MESSAGE",
      "message": "<gold>Sending you to the Skyblock world..."
    },
    {
      "type": "DELAY",
      "delay": 1.0
    },
    {
      "type": "MOVE-SERVER",
      "server": "skyblock"
    }
  ]
}

A player requires the permission node "oxygen.defined_commands.<command>" to execute a defined command, so in this case it'd be "oxygen.defined_commands.skyblock". This Skyblock command has an alias as well, so people can use /is for identical functionality. Note that alias commands still use the "root" command in permission checks, so using /is also requires "oxygen.defined_commands.skyblock".

This command runs three Player Actions:

  • SEND-MESSAGE: sends the player the MiniMessage formatted string in chat

  • DELAY: delays subsequent commands by the delay (float, i.e. decimal), in seconds

  • MOVE-SERVER: moves the player to a different server on the proxy

So from the player perspective, they're sent a gold message saying "Sending you to the Skyblock world...", and one second later they're moved.

We've created a lot of Defined Commands already, which you can see in Player Actions

Feel free to suggest more actions that'd be useful for you.

Last updated