Skip to content
Daniel Saukel edited this page Feb 26, 2016 · 8 revisions

Welcome to the CommandsXL wiki.

English documentation

General information

CommandsXL is a simple plugin which offers better command control. Using CXL, multiple commands can be linked to one. This command can be executed as operator, with the player's normal permissions or as the console if special arguments are entered.

Creation of a command

Each command has its own YAML script file out of which it is loaded. The name can be any id for the command. The script has to be created manually at plugins/CommandsXL/commands and should be setup similar to this scheme:

commands:
  version: [world]
  help: []
  deop %name%: []
permission: 'my.awesome.permission.node'

The command "/version" will only be executed if the player is in the world world.

Permissions

As mentioned in the example above, the permission node required to execute the command is configurable. To execute the command as console or operator, .asconsole or .asop has to be added. If no node is specified, cxl.[ID] will be used automatically.

Commands

/commandsxl,cxl [console|op|default] [file name of the linked command without .yml] [delay in seconds]

The first argument specifies how the command is executed, the second which one. /cxl reload may be performed to reload the script files. It is recommended to use the built-in alias feature of CraftBukkit to apply a prettier name to the command.

API

CommandsXL provides a simple API.

To get a linked command from ID: CCommand cCommand = CommandsXL.getPlugin().getCCommands().getCCommand(id)

To execute a linked command: new CCommandExecutionTask(Player, CCommand, CommandSender, boolean).runTaskLater(delay)

For further information, have a look at the JavaDoc.

Of course, you can add CommandsXL as a dependency to your plugin:

<dependencies>
    <dependency>
        <groupId>io.github.dre2n</groupId>
        <artifactId>commandsxl</artifactId>
        <version>2.1.2</version>
    </dependency>
</dependencies>
...
<repositories>
    <repository>
        <id>dre2n-repo</id>
        <url>http://feuerstern.bplaced.net/repo/</url>
    </repository>
</repositories>

Deutsche Dokumentation

Grundlegende Informationen

CommandsXL ist ein simples Plugin, das bessere Kontrolle über Befehle bietet. Mit CXL können verschiedene Befehle zu einem verlinkt werden. Dieser Befehl kann mit speziellen Argumenten als Operator, mit den gewöhnlichen Rechten des Spielers oder als die Konsole ausgeführt werden.

Erstellen eines Befehls

Jeder Befehl hat ein eigenes YAML-Skript-File, aus dem er geladen wird. Der Name kann hierbei eine beliebige ID des Befehls sein. Die Skripts werden im Verzeichnis plugins/CommandsXL/commands manuell erstellt und folgen diesem Schema:

commands:
  version: [world]
  help: []
  deop %name%: []
permission: 'my.awesome.permission.node'

Der Befehl "/version" wird nur ausgeführt, wenn der Spieler in der Welt "world" ist.

Permissions

Wie im Beispiel oben sichtbar, kann die für den Befehl notwendige Permission-Node vom Benutzer eingestellt werden. Für das Ausführen des Befehls als Konsole oder als Operator muss allerdings .asconsole oder .asop angefügt werden. Wird keine Permission festgelegt, so wird automatisch cxl.[ID] genutzt.

Befehle

/commandsxl,cxl [console|op|default] [File-Name des verlinkten Befehls ohne .yml-Endung] [Verzögerung in Sekunden]

Mit dem ersten Argument wird angegeben, wie der Befehl ausgeführt werden soll. Das zweite Argument spezifiziert einen der geladenen Befehle. Mit dem Befehl /cxl reload können die Skript-Files erneut geladen werden. Mit CraftBukkits eingebauter Alias-Funktion kann der Befehl einen schöneren Namen bekommen.