CommandAlias icon

CommandAlias -----

Easy, limitless plugin for command aliases (+ Bungee Support)



What?
This is an easy to setup, lightweight plugin for your server, not even triggering chat filters and no dupe logging in console! Even has placeholder support :eek: It is perfect for any level of configuration experience.

How?
It's easy! Simply download the plugin, drag and drop it into your plugin file. Restart your server, and you're already half way there.
It will work on all server versions so no need to worry yourself about compatibility issues!

Configuration!
With the unbelievably simple, yet dynamic configuration file, you'll become a quick expert.
The default config will look exactly like this: Click Me

Below is in reference to the default config.
"gamemode" is the actual command, and below are the new ways you can access this command. With this, you can now simply type /gm and you will get the gamemode command, like so:
[​IMG]

Since there is no permission specified in the config, it will not check.

Whereas, if you do "/peepsonline" it will show an unknown command because it is disabled!

Sending custom messages
You can also send custom messages, just add the prefix of -msg- before the command lable, set the first "aliases" value to the message you want to send (supports colors!) and wowzers!

[​IMG]

Console commands can be run from any type of alias, see the spoiler for more info.

You can add aliases for other servers! Just add the prefix of " -server-" before your server name, exactly as it is in your Bungee config. If the player did not connect through the Bungee network nothing will happen. In alias, set what you want the user to connect with instead of /server serverName

In regards to the permission, you can simply enter the permission node you want, and it will deny users lacking the permission to use this, helpful for donator perks! If you don't want one, that's okay, just leave the field blank.

From 1.6 you can have console commands run when an alias is run. The placeholder %alias% is avaliable and can work like so.
Code (Text):
 list:
    aliases:
      - peepsonline
    console-command: 'say %name% just ran %alias%!'
Argument placeholders are supported for this, see the respective spoiler for more info. (Does not trail arguements)

To add your own alias you can either edit the existing bit to suit yourself or, copy one of the sections and edit it.

And it's as simple as that...

If you're feeling adventurous, here are some advanced options that you can use to enhance your server even more.
Argument Placeholders
If you have an alias which isn't so straight forward, like /lp user Potato parent set GroupName, and you want to shorten it, you may have some issues. But in 1.6, not anymore :)
You can use the placeholders {0} , {1}, ... {100000} etc. (/{0} {1} ...) in your command aliases to manipulate the order which placeholders are filled in.

For example,
Code (YAML):
 'lp user {1} parent set {2}':
    aliases
:
     - setgroup
    enabled
: true
Will allow for /setgroup xEline Cheescake. Unused arguments will be trailed on the end UNLESS, you put a placeholder in which cannot be reached in the context of how many arguments provided. Like if you do "verycomplex {6} command {1} {2}" for /complex. If you only do '/complex'
'verycomplex' will be run alone. Likewise with '/complex arg1 arg2 arg3 arg4', only 'verycomplex' will be run and there will be no trailing arguments. (like arg1 -> 3)

Running several commands from one alias

If you want to run several commands from one command, you can do so.

Set "keep-iterating-when-match" to "true" in advanced.

In your config have a section like:
Code (YAML):
 god:
    aliases
:
     - buff
    enabled
: true
  fly
:
    aliases
:
     - buff
    enabled
: true
  flyspeed 5
:
    aliases
:
     - buff
    enabled
: true
As you can see, for every single command it loops back to the same alias so that it will execute all of these.

Run Conditions
There are several run conditions which can be appended to each alias section and look like this:
Code (Text):
  -msg-heal:
...
    conditions:
      # With "0", it will only show if no args (doesn't include label)
      args: 0
As of 1.5, there are 4 default run conditions you can use:
  • args -> the args input in the alias
  • world -> the world the player is in (can also be a list of worlds)
  • gamemode -> the player's gamemode
  • health -> the player's health
Just add them into a "conditions" section under any alias you have. Multiple can be used for one alias.

Letting a command run if the player doesn't have the alias permission
This will mean that if a user does NOT have the permission to run said alias, it will ignore the event and let other plugins handle it.

This can be used in joint with alias run conditions (as of 1.4.2 there is only one, "args")
Code (Text):
  -msg-heal:
    aliases:
      - '&dHeal who?'
    enabled: true
    # Conditions as of 1.4.2
    #   "args" -> integer (args in command)
    conditions:
      # With "0", it will only show if no args (doesn't include label)
      args: 0
Here is an example which will only run this alias when there are 0 args, i.e "/heal" ONLY.


Hope this helps accomidate to advanced users, as all these features were requested by the great community :)
I will try and accommodate to most of them but remember this is a public plugin and being lightweight and easy to use is one of the core values.

Commands?
There a couple of subcommands which you can use to edit the aliases in game, or in config and load it into your game, effective immediately. They are as follows:
  • /ca reload -> commandalias.reload - ability to reload the file
  • /ca toggle -> commandalias.toggle - ability to toggle nodes
When doing a command, if there was an error with the plugin, it will tell you to avoid having to scroll through console forever!

Placeholders?
There also placeholders support. There are a couple native placeholders:
  • %name% - The name of the sender
  • %display_name% - The display name of the sender.
Or you can use any placeholder (that you have downloaded) from PlaceholderAPI. You can use which you want.

Source / API?
If you're interested in the technical side to the plugin (even though it's very basic), you can find it here (It's written in Kotlin by the way - the cool kids offspring of Java).

It also has an API for managing aliases, run conditions and placeholders if you're interested.


Stuck?
I will be happy to help! Join https://discord.gg/c2myRcs and ping "Me gusta" or post something in the discussion.

Metrics
This plugin comes equipt with plugin metrics which will track certain information about your server such as:
  • Player count
  • Is server in online mode
  • Server version
  • The version of this plugin you're running
  • How many cores the server CPU has
  • Server architecture
  • Server OS
  • Server location
  • Server's Java version
If you don't want this disclosed, you can disable it in the "bStats" config in the "bStats" directory in your plugins folder. More information can be found here: https://bstats.org

If you found this plugin helpful be sure to leave a review and suggestions on how this plugin can be improved!
Resource Information
Author:
----------
Total Downloads: 6,761
First Release: Jul 23, 2017
Last Update: Dec 14, 2020
Category: ---------------
All-Time Rating:
16 ratings
Version -----
Released: --------------------
Downloads: ------
Version Rating:
----------------------
-- ratings