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 PluginYAML, 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 commands & permissions field[^1] on it.

PluginYAML 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

PluginYAML.registerCommand()

1 - The Command class

Events

PluginYAML.registerEvent()

1 - The Listener class

Permissions

PluginYAML.registerPermission()

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

Make sure to use these on your plugin.yml file:

commands: {}
permissions: {}

Last updated

Was this helpful?