October 2014
Beginner to intermediate
285 pages
6h 24m
English
Sometimes when writing a plugin, you might want to restrict the commands you’ve created—maybe only ops should run them, or maybe you have different kinds of players or teams, and each should only be able to run certain commands.
For instance, suppose you want to restrict the firebow commands to a select set of players. We’ll invent a new name; let’s call it commands.firebow.enable.
You can then use the permissions field in the @Command annotation to check if the player issuing the command is one of the chosen few:
| | @Command(aliases = { "nofirebow" }, |
| | description = "Disable firebow behavior", |
| | permissions = { "commands.firebow.enable" }, |
| | toolTip = "/nofirebow") |
Now only players who have the permission for ...
Read now
Unlock full access