⚙️
T-MiniGameAPI
WebsiteDiscord
1.4.0
1.4.0
  • 🏠Home
  • 💻Maven and Gradle
  • 📦Minigame setup
  • 🖱️Plugins are using this libarary
  • Basic features
    • 🗺️Configuration
      • 🎯Configurators
      • 🔴Override Configuartors
    • 🖱️Commands
      • 🧔Parent commands
      • 🧒Sub commands
      • 📑Tab completer
      • ®️Command registration
    • 🧑Models
      • 📦File model
        • 🟢Single file
        • 🟠Many files
      • 💡DB model
      • 🧑‍🦱Users
    • 📔Loaders
      • 📗Loader
        • 📂File loader
        • 💾Database loader
    • 💬Library commands
  • Minigame features
    • 🅰️Arena system
      • 🟢Arena
      • 🔵ArenaManager
    • 🎮Game system
      • 🔴Game Manager
      • 🔵Game State
      • 🟡Users in game
      • 🟢Teams
    • ⏰Timers
      • 😀SimpleTimer
      • ✨XpTimer
    • 🪙Coins system
      • 🟢UserCoins
      • 🔵UserCoinsManager
    • ✨Statistics system
      • 🟢Default statistics system
      • 🔵Your own statistics system
    • 💥Cosmetics system
      • 📀Cosmetic
        • 💕ParticleCosmetic
      • ✳️Cosmetics Manager
      • 🧒Users' cosmetics
        • 💿UserCosmeticsManager
        • ✅UserCosmetics
  • Addons
    • 🎁What is addon?
    • 🖍️How to create addon?
    • 📃Addons list
Powered by GitBook
On this page
  1. Addons

How to create addon?

Addon can be created like a simple Spigot plugin.

Addon has plugin.yml and addon.yml files.

Getting started

Add dependency

 <dependency>
    <groupId>com.github.timsixth.MinigameAPI</groupId>
   <artifactId>addons-api</artifactId>
   <version>version</version>
   <scope>provided</scope>
</dependency>

How to create a main class?

public class MysMiniGameAddon extends MiniGameAddon {

    @Override
    public void onEnable() {
        super.onEnable(); //this is important
        //code...
    }
}

How to register sub-commands?

Addon can add sub-commands to two main minigame commands (Admin and player command).

addAdminSubCommand(new MyAdminSubCommand());
addPlayerSubCommand(new MyPlayerSubCommand());

How to use the loaders class with an addon?

UserDBLoader userDbLoader = new UserDBLoader();

getLoaders().registerLoaders(userDbLoader);
getLoaders().load(userDbLoader);

How to create addon.yml?

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 
PreviousWhat is addon?NextAddons list

Last updated 1 year ago

🖍️