Class TeamAssignEvent

java.lang.Object
org.bukkit.event.Event
com.andrei1058.bedwars.api.events.gameplay.TeamAssignEvent

public class TeamAssignEvent extends org.bukkit.event.Event
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.bukkit.event.Event

    org.bukkit.event.Event.Result
  • Constructor Summary

    Constructors
    Constructor
    Description
    TeamAssignEvent(org.bukkit.entity.Player player, ITeam team, IArena arena)
    Called for each player when the waiting countdown == 0 You can cancel each team assign event in order to manage them yourself but make sure to set BedWarsTeam#setBedDestroyed(false) if teams are marked as eliminated when they are not, and use BedWarsTeam#firstSpawn(p) to spawn them.
  • Method Summary

    Modifier and Type
    Method
    Description
    Get the arena
    static org.bukkit.event.HandlerList
     
    org.bukkit.event.HandlerList
     
    org.bukkit.entity.Player
    Get the player
    Get the team
    boolean
    Check if the assign was cancelled
    void
    setCancelled(boolean cancelled)
    Cancel/ Allow the assign event

    Methods inherited from class org.bukkit.event.Event

    getEventName, isAsynchronous

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • TeamAssignEvent

      public TeamAssignEvent(org.bukkit.entity.Player player, ITeam team, IArena arena)
      Called for each player when the waiting countdown == 0 You can cancel each team assign event in order to manage them yourself but make sure to set BedWarsTeam#setBedDestroyed(false) if teams are marked as eliminated when they are not, and use BedWarsTeam#firstSpawn(p) to spawn them. But first assign them to a team BedWarsTeam#addPlayers(p).

      READ THIS: If you want to assign the player another team there's no ned of a setTeam method in this event. Just use ITeam.addPlayers(Player...) right after using setCancelled(boolean).

  • Method Details

    • getTeam

      public ITeam getTeam()
      Get the team
      Returns:
      the team assigned to the player
    • getPlayer

      public org.bukkit.entity.Player getPlayer()
      Get the player
      Returns:
      the target player
    • getArena

      public IArena getArena()
      Get the arena
      Returns:
      arena
    • isCancelled

      public boolean isCancelled()
      Check if the assign was cancelled
    • setCancelled

      public void setCancelled(boolean cancelled)
      Cancel/ Allow the assign event
    • getHandlers

      public org.bukkit.event.HandlerList getHandlers()
      Specified by:
      getHandlers in class org.bukkit.event.Event
    • getHandlerList

      public static org.bukkit.event.HandlerList getHandlerList()