Guide to use the Command dispatcher
CommandDispatcher will fill every PlaceholderAPI placeholder if PAPI is installed. It also supports legacy and MiniMessage color formats if the command type is message . It can also interact with the built-in user metadata. By default, if no prefix is specified at the start of the command, it will be a console command.
Prefixes define how should a command be executed or what it does. For example, it can be a console command, a player performed command, a simple message to a player, or meta data modification, or even just a placeholder parsing operation.
Executes the command in the console. Placeholders are supported.
[console] say Hi %player_name%
Executes the command as the player. Placeholders are supported.
[player] level milestones
Sends a message to the player. Placeholders and every type of color codes are supported.
[message] &6Hey what's up %player_name%? <#3d3d3d>MiniMessage also supported!
Sends a message to the players actionbar. Placeholders and every type of color codes are supported.
[actionbar] &6Hey what's up %player_name%? <#3d3d3d>MiniMessage also supported!
Play a sound for the player. Sound - volume -pitch
[sound] entity.villager.yes 1 1
Closes the currently open inventory. Useful for menus.
[close]
parses a placeholder. Can be useful to start placeholder-based cooldown or something.
[placeholder] %player_name%
Give money to the player. (Economy argument can be omitted)
[give-money] 1000 economy={Vault}
Withdraw money from the player. (Economy argument can be omitted)
[take-money] 1000 economy={Vault}
Opens a custom AuroraLib powered GUI menu for the player. Arguments after the menu id are optional.
[open-gui] menu_id test={example} arg2={100}
Take items from the player's inventory. This only supports custom items, defined in Item config. List your items separated by spaces and add /number at the end to specify how many of those item should be taken from the player's inventory.
[take-items] oraxen:some_item/32 mythicmobs:super_sword/1
Gives an item to the player. This only supports custom items, defined in Item config. Add /number at the end to specify how many of that item should be added to the player's inventory. If the items don't fit in the player's inventory, then the item will be dropped to the ground. If you add true at the end, it will add excess items to the player's stash instead. This is not recommended though since they can easily overwhelm the stash.
[give-item] oraxen:some_item/32
[give-item] oraxen:some_item/32 true
Sets or overrides a meta value for the given key for the user.
[meta:set:mymeta] value (single number or text)
Removes a meta key from the user.
[meta:remove:mymetakey]
Increments a meta value by the provided number or 1 if there isn't any provided value. If the meta doesn't exist it will be created.
[meta:increment:mymetakey] optional number here
Decrements a meta value by the provided number or 1 if there isn't any provided value. If the meta doesn't exist it will be created. It doesn't allow it to go below 0.
[meta:decrement:mymetakey] optional number here
You can register custom prefix handlers or even override the default ones.
AuroraAPI.registerCommandDispatcherActionHandler("my-prefix", (player, input) -> {
// Do something. Note that your prefix is already removed here from the input
});
Then you can write something like this in your configs everywhere:
on-click:
- "[my-prefix] this is the input string"