How to create a command?

G.M

Member
Well I've looked at the source code of many plugins, I still don't get how to create a command and use it. Somebody please tell me how to do that? Thx.
 

CreeperFace

🇨🇿🇺🇦 Слава Україні!
Staff member
the easiest way to process the command is probably the onCommand() method inherited from Plugin. like this
and you will need to register your commands in plugin.yml (example here)
 

G.M

Member
so if I want 2 create a permision, I only need to register it in plugin.yml, no need to anything in the plugin source code, am I correct
 

CreeperFace

🇨🇿🇺🇦 Слава Україні!
Staff member
so if I want 2 create a permision, I only need to register it in plugin.yml, no need to anything in the plugin source code, am I correct
right. But you can register them dynamically in the code as well.
 

G.M

Member
Get. And how do I set the permision default to another permision like creating a permision named "example" and ops will own it by default, how should I do that?
 

CreeperFace

🇨🇿🇺🇦 Слава Україні!
Staff member
Get. And how do I set the permision default to another permision like creating a permision named "example" and ops will own it by default, how should I do that?
set default to "op"
 
Top