Class LifestealerPreUserBanEvent
java.lang.Object
org.bukkit.event.Event
dev.chicoferreira.lifestealer.events.LifestealerPreUserBanEvent
- All Implemented Interfaces:
org.bukkit.event.Cancellable
public class LifestealerPreUserBanEvent
extends org.bukkit.event.Event
implements org.bukkit.event.Cancellable
Event that is called before a user is banned when he dies.
You can change the duration of the ban in this event.
This event is NOT called when the user is banned by the ban command, only when the user dies with less than the minimum amount of hearts.
If you wish to listen to the command as well, you should use LifestealerPostUserBanEvent.
This event is called before the user is kicked and the ban commands are executed.
This event will still be called even if the external flag is set to true in the LifestealerUserController.BanSettings
Thread-safety (WARNING): This event is called with a write lock active on the user.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result -
Constructor Summary
ConstructorsConstructorDescriptionLifestealerPreUserBanEvent(@NotNull org.bukkit.entity.Player player, @NotNull LifestealerUser user, @NotNull Duration banDuration) Constructs a newLifestealerPreUserBanEvent. -
Method Summary
Modifier and TypeMethodDescription@NotNull DurationGets the duration of the ban.static org.bukkit.event.HandlerListGets the handler list.@NotNull org.bukkit.event.HandlerListGets the handler list.@NotNull org.bukkit.entity.PlayerGets the player going to be banned.@NotNull LifestealerUsergetUser()Gets theLifestealerUserassociated with the player.booleanvoidsetBanDuration(@NotNull Duration banDuration) Sets the duration of the ban.voidsetCancelled(boolean cancel) Methods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
LifestealerPreUserBanEvent
public LifestealerPreUserBanEvent(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull LifestealerUser user, @NotNull @NotNull Duration banDuration) Constructs a newLifestealerPreUserBanEvent.- Parameters:
player- ThePlayerwho is going to be banned.user- TheLifestealerUserassociated with the player.banDuration- The duration of the ban.
-
-
Method Details
-
getPlayer
@NotNull public @NotNull org.bukkit.entity.Player getPlayer()Gets the player going to be banned.- Returns:
- The banned player.
-
getUser
Gets theLifestealerUserassociated with the player.- Returns:
- The
LifestealerUserassociated with the player.
-
getBanDuration
Gets the duration of the ban.- Returns:
- The duration of the ban.
-
setBanDuration
Sets the duration of the ban.- Parameters:
banDuration- The duration of the ban.
-
isCancelled
public boolean isCancelled()- Specified by:
isCancelledin interfaceorg.bukkit.event.Cancellable
-
setCancelled
public void setCancelled(boolean cancel) - Specified by:
setCancelledin interfaceorg.bukkit.event.Cancellable
-
getHandlers
@NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()Gets the handler list.- Specified by:
getHandlersin classorg.bukkit.event.Event- Returns:
- the handler list
-
getHandlerList
public static org.bukkit.event.HandlerList getHandlerList()Gets the handler list.- Returns:
- the handler list
-