⚙️
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. Minigame features
  2. Timers

XpTimer

How to implement XPTimer?

public class XpStartGameTimer extends XpGameTimer {

    public XpStartGameTimer(Game game, int minPlayers, int time) {
        super(game, minPlayers, time);
    }

    @Override
    public void onCancel() {
        game.sendMessage("starting cancelled");
        //the method calls when the countdown was stopped
    }

    @Override
    public void onEnd() {
        super.onEnd();
        //the method calls when the countdown was ended
        game.getPlayingUsers().forEach(userGame -> {
            Player player = userGame.toPlayer();

            player.getInventory().clear();
            player.teleport(game.getArena().getLocationByName("spawn"));
        });

        game.setState(new PlayingGameState());
    }
}
PreviousSimpleTimerNextCoins system

Last updated 1 year ago

⏰
✨