Klasse PlayerBanEvent

java.lang.Object
me.kzlyth.api.events.ZenithEvent
me.kzlyth.api.events.ban.PlayerBanEvent

public class PlayerBanEvent extends ZenithEvent
Event fired when a player is banned.

For detailed documentation and examples, see: https://docs.zenith-studios.org/

Example:


 ZenithEventBus.getInstance().subscribe(PlayerBanEvent.class, event -> {
     getLogger().info(event.getPlayerName() + " was banned: " + event.getReason());
 });
 
Seit:
1.2.3
Autor:
Zenith-Studios
  • Konstruktordetails

    • PlayerBanEvent

      public PlayerBanEvent(@NotNull @NotNull UUID playerUuid, @NotNull @NotNull String playerName, @Nullable @Nullable UUID staffUuid, @NotNull @NotNull String staffName, @NotNull @NotNull String reason, int caseId, boolean ipBan, long durationSeconds)
      Constructs a new PlayerBanEvent.
      Parameter:
      playerUuid - The UUID of the banned player
      playerName - The name of the banned player
      staffUuid - The UUID of the staff member (null for console)
      staffName - The name of the staff member
      reason - The reason for the ban
      caseId - The case ID
      ipBan - Whether this is an IP ban
      durationSeconds - The duration in seconds (-1 for permanent)
  • Methodendetails

    • isIpBan

      public boolean isIpBan()
      Checks if this is an IP ban.
      Gibt zurück:
      True if IP ban, false otherwise
    • getDurationSeconds

      public long getDurationSeconds()
      Gets the duration of the ban in seconds.
      Gibt zurück:
      The duration in seconds, or -1 for permanent
    • isPermanent

      public boolean isPermanent()
      Checks if this is a permanent ban.
      Gibt zurück:
      True if permanent, false otherwise