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
ConstructorDescriptionTeamAssignEvent
(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 TypeMethodDescriptiongetArena()
Get the arenastatic org.bukkit.event.HandlerList
org.bukkit.event.HandlerList
org.bukkit.entity.Player
Get the playergetTeam()
Get the teamboolean
Check if the assign was cancelledvoid
setCancelled
(boolean cancelled) Cancel/ Allow the assign eventMethods inherited from class org.bukkit.event.Event
getEventName, isAsynchronous
-
Constructor Details
-
TeamAssignEvent
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 usingsetCancelled(boolean)
.
-
-
Method Details
-
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
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 classorg.bukkit.event.Event
-
getHandlerList
public static org.bukkit.event.HandlerList getHandlerList()
-