Package me.kzlyth.api.events.ban
Klasse PlayerBanEvent
java.lang.Object
me.kzlyth.api.events.ZenithEvent
me.kzlyth.api.events.ban.PlayerBanEvent
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
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibunglongGets the duration of the ban in seconds.booleanisIpBan()Checks if this is an IP ban.booleanChecks if this is a permanent ban.Von Klasse geerbte Methoden me.kzlyth.api.events.ZenithEvent
getCaseId, getPlayer, getPlayerName, getPlayerUuid, getReason, getStaffName, getStaffPlayer, getStaffUuid, isCancelled, setCancelled
-
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 playerplayerName- The name of the banned playerstaffUuid- The UUID of the staff member (null for console)staffName- The name of the staff memberreason- The reason for the bancaseId- The case IDipBan- Whether this is an IP bandurationSeconds- 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
-