Class EntityChangeTeamEvent

java.lang.Object
org.bukkit.event.Event
org.bukkit.event.entity.EntityEvent
All Implemented Interfaces:
org.bukkit.event.Cancellable

public class EntityChangeTeamEvent extends EntityTeamEvent implements org.bukkit.event.Cancellable
Thrown when an entities Team is about to change.

Can be cancelled team to not apply the new Team to the entity who is involved in this event.

A team of the value null counts as no team. E.g. setting the new team to null will remove the player from his team.

  • Constructor Details

    • EntityChangeTeamEvent

      protected EntityChangeTeamEvent(@NotNull @NotNull org.bukkit.entity.Entity entity, @Nullable @Nullable Team team, @Nullable @Nullable Team newTeam)
  • Method Details

    • setNewTeam

      public void setNewTeam(@Nullable @Nullable Team newTeam)
    • getNewTeam

      @Nullable public @Nullable Team getNewTeam()
    • getHandlers

      @NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()
      Description copied from class: CustomEntityEvent
      Returns the HandlerList for this event type.

      Bukkit requires each concrete event class to define its own static HandlerList instance and to return it from this method. This is necessary for Bukkit’s event registration and dispatch system.

      Overrides:
      getHandlers in class EntityTeamEvent
      Returns:
      the handler list for this event (never null)
    • getHandlerList

      @NotNull public static @NotNull org.bukkit.event.HandlerList getHandlerList()
    • isCancelled

      public boolean isCancelled()
      Specified by:
      isCancelled in interface org.bukkit.event.Cancellable
    • setCancelled

      public void setCancelled(boolean b)
      Specified by:
      setCancelled in interface org.bukkit.event.Cancellable