USkyWars API

Sep 16, 2019
USkyWars API
  • How to use the new api:
    1.Create the class where you are going to use the api the class you created implements the listener
    3.create the public void and add @EventHandler to it
    4.and to this public void between parentesis adds the GameEndEvent and imports the class
    5.and add your code


    Code (YAML):
    import teamgx.kubig.skywars.api.GameEndEvent;
    import teamgx.kubig.skywars.manager.GameManager;

    import org.bukkit.inventory.meta.FireworkMeta;
    import org.bukkit.entity.Firework;
    import org.bukkit.Color;
    import org.bukkit.FireworkEffect;
    import org.bukkit.entity.Firework;
    import org.bukkit.entity.Player;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.Listener;

    public class GameWinEffect
    implements Listener {

        public void onGameEnd(GameEndEvent e) {
         Player p = (Player)e.getWinner();
         Game game = GameManager.get().getP(p);
         if (game == null) {

        public void launch_fireworks(Player p) {
         Firework fireworks = (Firework)p.getWorld().spawn(p.getLocation().clone().add(0.5D, 0.5D, 0.5D), Firework.class);
         FireworkMeta fireworksmeta = fireworks.getFireworkMeta();
         FireworkEffect fireworkseffect = FireworkEffect.builder().with(FireworkEffect.Type.BALL).withColor(Color.YELLOW).withFade(Color.AQUA).flicker(true).trail(true).build();

    6. and register the class where the event is with the Bukkit.getPluginManager().registerEvents(new GameWinEffect(), this); in the main class
  • Loading...
  • Loading...