Skip to content

YggdraPro/TAGA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

84 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The Asgard Game API

API for creating mini-games in minecraft. Made by The Asgard with love 💙

version wiki docs minecraft discord

How to use

Requires Minecraft 1.16.5 or higher. Works with PaperMC, SpigotMC, MohistMC, CraftBukkit etc.

For Maven

<dependencies>
  <dependency>
    <groupId>fun.asgard</groupId>
    <artifactId>TAGA</artifactId>
    <version>v1.2.0</version>
  </dependency>
</dependencies>  

For Gradle

repositories {
  mavenCentral()
}
dependencies {
  implementation 'fun.asgard:TAGA:v1.2.0'
}

Brief Guide

PLEASE READ OUR DOCUMENTATION ALSO! THIS GUIDE IS NOT ALL THE POSSIBILITIES OF OUR API!

Initialization

public TAGA taga = new TAGA(this);    

Game manager

Create the Game
//                                              |Get the world|         |Game name|    |Game time|
Game game = this.taga.getGameManager().createGame(Bukkit.getWorld("world"), "ExampleGame", 5 * 60 * 1000);

// If you want when a player is kicked, he is disconnected from the game ( Default is false )
game.setKickOnLeave(true);
Get the Game
//                                          |Game name|
Game game = this.taga.getGameManager().getGame("ExampleGame");
Get all games
//      |Name| |Game|
HashMap<String, Game> games = this.taga.getGameManager().getGames();

Game

Connect a player to the game
//               |The player|
game.connectPlayer(player);
Disconnect a player from the game
//                  |The player|
game.disconnectPlayer(player);
Get game players
game.getPlayers();
Start the Game
game.start()
Stop the Game
// Stop the game and save the world (Write false if you don't want to save the world)
game.stop(true)
Shutdown the Game
// If you don't want the GameStopEvent to work
game.shutdown()
Creating a task for the game
game.runGameTask(() -> {
  game.getPlayers().forEach(player -> player.sendMessage("1 minute of the game has passed"))
//|Delay| |Period|
}, 1000, 60 * 1000)

PLEASE READ OUR DOCUMENTATION ALSO! THIS GUIDE IS NOT ALL THE POSSIBILITIES OF OUR API!
If you have any problems, write to us in the discord-shield