Class GroupSwitchPreEvent

java.lang.Object
com.github.happyuky7.swi.api.event.PlayerEvent
com.github.happyuky7.swi.api.event.GroupSwitchPreEvent
All Implemented Interfaces:
Cancellable, SwiEvent

public final class GroupSwitchPreEvent extends PlayerEvent implements Cancellable
Fired right before a player's data is swapped from one context to another.

Cancelling it keeps the player's current data (nothing is saved, cleared or loaded) and the player keeps being tracked in the old context. The world change/teleport itself is not undone.

  • Constructor Details

    • GroupSwitchPreEvent

      public GroupSwitchPreEvent(@NotNull @NotNull Object player, @NotNull @NotNull UUID uuid, @NotNull @NotNull String name, @NotNull @NotNull GroupContext from, @NotNull @NotNull GroupContext to, @Nullable @Nullable String regionId)
  • Method Details

    • from

      @NotNull public @NotNull GroupContext from()
    • to

      @NotNull public @NotNull GroupContext to()
    • regionId

      @Nullable public @Nullable String regionId()
      Returns:
      the region id that caused the switch when to() is a region context, else null
    • isCancelled

      public boolean isCancelled()
      Specified by:
      isCancelled in interface Cancellable
    • setCancelled

      public void setCancelled(boolean cancelled)
      Specified by:
      setCancelled in interface Cancellable