Loading Commands & Events

How to load command & events using zAPI

Using zAPI to load commands, events, permissions & tab completers

In order to load commands & events using zAPI you need a class called PluginYAMLManager, that basicly loads all the commands, tab completers, permissions & events without you needing to put anything in plugin.yml, allthough you still need to have on it.

PluginYAMLManager is a abstract class, which means it doesn't need any initialization or anything like that, so to load anything on it you basicly use this functions:

Load
Usage
Params

Commands

PluginYAMLManager.registerCommand()

1 - The name of the command.
2 - The CommandExecutor for the command.
3 (Optional) - The cooldown of the command
4 (Optional) - The TabCompleter for the command.
5 - The description of the command.
6 - The aliases for the command.

Events

PluginYAMLManager.registerEvent()

1 - The Listener class

Permissions

PluginYAMLManager.registerPermission()

1 - The permission
2 (Optional) - Description
3 (Optional) - PermissionDefault
4 (Optional) - Permission childrens

Last updated

Was this helpful?