-
Notifications
You must be signed in to change notification settings - Fork 22
Custom Commands
Commands like '/tag nick' are long and can be annoying. In the following example, I illustrate how you can allow the players to just type '/nick' instead.
You can find and uncomment this code like the example below in rules/command.rs and learn more about how it works at Rules.
# -----------------------------------------------------------------------------------------------
# Create a /nick command that executes a longer /tag nick command.
# -----------------------------------------------------------------------------------------------
# Create a simple alias for /tag nick to just type /nick instead, using two rules.
# This rule only sends the usage message, and the rule below actually forwards the command.
match ^\/nick$
require perm nick.set.own &cInsufficient permission ({permission}).
then warn &cDescription: Sets your own nickname.
then warn &cUsage: /nick <nick>
then deny
# An example used for /nick command alias with the help of group matching (see the $2), it will
# replace what players type in /nick - that is pulled from the (.*) part
match ^\/nick (.*)
require perm nick.set.own &cInsufficient permission ({permission}).
then command tag nick $1
then deny
Using our rules you can literally create unlimited amount of aliases, simple and complex, the way you want it and how you need it. Check out our Rules section for how they work, and see the defaults in rules/ for tons of examples.
Some people prefer Bukkit's way of creating command aliases. This is more limited but will work just fine, here's a tutorial on it: https://bukkit.gamepedia.com/Commands.yml
© MineAcademy | Code Unique Minecraft Plugins & Servers In 20 Days
Installation
Troubleshooting
Basics
Learn
- Channels
- Formats
- Rules
- Rules Creator
- Messages
- Variables
- JavaScript Variables
- Running JavaScript Code
- Logs
- Spying
- Books
Tweaking
- Performance
- Chat Bots
- Groups
- Sound Notify
- Newcomer
- Super Cool Messages
- Custom Commands
- Listener Priorities
- JSON
- API
Tutorials
About