Class PlayerEvent

java.lang.Object
com.github.happyuky7.swi.api.event.PlayerEvent
All Implemented Interfaces:
SwiEvent
Direct Known Subclasses:
GroupSwitchPostEvent, GroupSwitchPreEvent, PlayerDataLoadEvent, PlayerDataSaveEvent

public abstract class PlayerEvent extends Object implements SwiEvent
Base class of events about an online player.
  • Constructor Details

    • PlayerEvent

      protected PlayerEvent(@NotNull @NotNull Object player, @NotNull @NotNull UUID playerUuid, @NotNull @NotNull String playerName)
  • Method Details

    • playerUuid

      @NotNull public @NotNull UUID playerUuid()
    • playerName

      @NotNull public @NotNull String playerName()
    • platformPlayer

      @NotNull public @NotNull Object platformPlayer()
      Returns:
      the platform player object (org.bukkit.entity.Player or ServerPlayer)
    • player

      @NotNull public <P> P player(@NotNull @NotNull Class<P> type)
      Typed access to the platform player, e.g. event.player(Player.class).
      Throws:
      ClassCastException - when the type does not match the running platform