⚙️
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

Minigame setup

The library requires T-DataBasesAPI on Paper 1.20.6 and newer versions.

https://github.com/timsixth/T-DataBasesAPI/releases

Every minigame must extend MiniGame class.

public class MyMinigamePlugin extends MiniGame 

You must implement two abstract methods getPlayerCommand and getAdminCommand.

These two methods are important to the addon system.

    @Override
    public ParentCommand getPlayerCommand() {
        return new PlayerCommand();
    }

    @Override
    public ParentCommand getAdminCommand() {
        return new AdminCommand();
    }

Sets two configurators before you call super.onEnable.

  1. Game configurator

  2. Plugin configurator

setDefaultGameConfigurator(new MyGameConfigurator());
setDefaultPluginConfigurator(new MyPluginConfigurator());

If you don't set these configurators, will apply default configurators.

super.onEnable(); //don't forget about this, it's very important

Set your command configurator:

setDefaultCommandConfigurator(new MyCommandConfigurator());

Init your own Game Manager.

You must set your own game manager, to define joining, leaving and drawing game.

setGameManager(new MyGameManager();

Register default listeners:

This method is important to define default listeners system

super.registerGameListeners();

On the end call loadAll method to load all data to default systems.

getLoaders().loadAll();

The whole implementation of the minigame main class

public class MinigamePlugin extends MiniGame {

    @Override
    public void onEnable() { 
        setDefaultGameConfigurator(new MyGameConfigurator());
        setDefaultPluginConfigurator(new MyPluginConfigurator());

        super.onEnable(); //don't forget about this, it's very important

        setDefaultCommandConfigurator(new MyCommandConfigurator(messages));
  
        setGameManager(new MyGameManager();

        super.registerGameListeners();

        getLoaders().loadAll();
    }

    @Override
    public ParentCommand getPlayerCommand() {
        return new TheTagCommand();
    }

    @Override
    public ParentCommand getAdminCommand() {
        return new AdminTheTagCommand();
    }
    
}
PreviousMaven and GradleNextPlugins are using this libarary

Last updated 1 year ago

📦