⚙️
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. Arena system

Arena

The arena has a lobby location, name as arena ID, and a Map of locations.

How to create a new instance of Arena?

The first parameter is an arena's name.

The second parameter is the lobby location.

The third parameter is a map of locations.

ArenaFactory arenaFactory = MiniGame.getArenaFactory();
Arena arena = arenaFactory.createArena("arenaName", player.getLocation(), new HashMap<>());
//or
Arena arena = arenaFactory.createArena("arenaName", player.getLocation());

How to manage arena locations.

void addLocation(name, location); //Addes new location
Map<String, Location> getLocations(); //Gets map of locations
void removeLocation(name); //Removes location from map
Location getLocationByName(name) //Gets location by name
Optional<Location> getLocation(name); //Gets location by name

Arena options (The arena stores options in YAML).

Thanks to arena options you can store some custom values.

Options options = arena.options();
//or
Options options = arena.getOptionsOrCreate();

options.setValue("key", "value"); //sets the value
Object value = options.getValue("key"); //gets the value
Object value = options.getValueOrDefault("key", "default"); //gets the value, or default value 
PreviousArena systemNextArenaManager

Last updated 12 months ago

🅰️
🟢