Addon can be created like a simple Spigot plugin.
Addon has plugin.yml and addon.yml files.
Copy < dependency >
< groupId >com.github.timsixth.MinigameAPI</ groupId >
< artifactId >addons-api</ artifactId >
< version >version</ version >
< scope >provided</ scope >
</ dependency >
Copy public class MysMiniGameAddon extends MiniGameAddon {
@ Override
public void onEnable () {
super . onEnable (); //this is important
//code...
}
}
Addon can add sub-commands to two main minigame commands (Admin and player command).
Copy addAdminSubCommand( new MyAdminSubCommand()) ;
addPlayerSubCommand( new MyPlayerSubCommand()) ;
Copy UserDBLoader userDbLoader = new UserDBLoader() ;
getLoaders() . registerLoaders (userDbLoader);
getLoaders() . load (userDbLoader);
Copy name : 'MyMiniGameAddon' #required, it is the id of addon
displayName : 'MyMiniGameAddon' #required, it will be shown on addon list
repository : 'timsixth/MyMiniGameAddon' #optional, only to download from github