Commands

Flags

List of all flags used in SunLight commands.

  • -s - makes silent command execution (target player won't be notified).
  • -f - executes command bypassing certain restrictions.

Main

Command aliases can be changed in the engine.yml. By default it's /sunlight or /sl.

  • /sunlight [help] - Show help page.
  • /sunlight reload - Reload the plugin.

Guide

Every SunLight command has its own "provider" - a mini-module responsible for one or more commands, typically those similar in function. Each provider has its own configuration file located in the /commands/ folder.

Provider commands come in two types: standalone and sub-command. Standalone commands can be accessed directly via /command. Sub-commands belong to a "parent" (aka root) command and are accessed via /root command.

Why this way? Imagine each provider as a mini-plugin adding commands under its own name. Every provider command has the option to be a standalone command. Take the kits-commons provider from the Kits module as an example:

  • It provides many standalone commands for managing kits.
  • Creating a standalone version for every single command can be inefficient for various reasons.
  • In such cases, we can group several (but not necessarily all!) provider commands under one common "parent" - /kits.
  • Commands that do not need a standalone version can then be accessed via /kits command.
  • Note that it is not mandatory to disable the standalone version of a command just to add it as a sub-command.

This allows you to easily customize the command structure on your server to whatever is most convenient for you and your players.

Configuration

Standalone versions of provider commands are located in the LiteralNodes section. This section contains all available provider commands identified by their internal names. In the example below, you can see commands like preview, editor, give, etc. Let's look at their parameters:

  • Enabled - Determines if the standalone version of the command is active.
  • Aliases - One or more names for the command. For example, the alias viewkit will result in /viewkit in-game.
  • Cooldown - The command's cooldown (in seconds). This applies to the player who executed the command.

The Root version of provider commands (if supported) is located in the RootNodes section. There can only be one. Let's look at its parameters:

  • Enabled - Determines if the root version of the command is active.
  • Aliases - One or more names for the command. For example, the alias kits will result in /kits in-game.
  • Name - The display name of the command. Used in "help" menus for a cleaner look.
  • Childrens - A list of provider commands to be included in this root command, along with their aliases. These use the internal command names from the LiteralNodes section. Here, only one alias can be specified per command. For example, give: grant will result in /kits grant in-game and will link to the provider's give command (inheriting its cooldown and other settings).
LiteralNodes:
  preview:
    Enabled: true
    Aliases: viewkit
    Cooldown: 0
  editor:
    Enabled: true
    Aliases: editkit
    Cooldown: 0
  give:
    Enabled: true
    Aliases: givekit
    Cooldown: 0
  get:
    Enabled: true
    Aliases: kit
    Cooldown: 0
  reset_cooldown:
    Enabled: false
    Aliases: resetkitcooldown
    Cooldown: 0
  list:
    Enabled: true
    Aliases: kitlist
    Cooldown: 0
  set_cooldown:
    Enabled: false
    Aliases: setkitcooldown
    Cooldown: 0
RootNodes:
  kits:
    Enabled: true
    Aliases: kits
    Name: Kits
    Childrens:
      preview: preview
      editor: editor
      give: give
      get: get
      reset_cooldown: resetcooldown
      list: list
      set_cooldown: setcooldown