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.

  • Constructor Details

    • LifestealerPreUserBanEvent

      public LifestealerPreUserBanEvent(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull LifestealerUser user, @NotNull @NotNull Duration banDuration)
      Constructs a new LifestealerPreUserBanEvent.
      Parameters:
      player - The Player who is going to be banned.
      user - The LifestealerUser associated 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

      @NotNull public @NotNull LifestealerUser getUser()
      Gets the LifestealerUser associated with the player.
      Returns:
      The LifestealerUser associated with the player.
    • getBanDuration

      @NotNull public @NotNull Duration getBanDuration()
      Gets the duration of the ban.
      Returns:
      The duration of the ban.
    • setBanDuration

      public void setBanDuration(@NotNull @NotNull Duration banDuration)
      Sets the duration of the ban.
      Parameters:
      banDuration - The duration of the ban.
    • isCancelled

      public boolean isCancelled()
      Specified by:
      isCancelled in interface org.bukkit.event.Cancellable
    • setCancelled

      public void setCancelled(boolean cancel)
      Specified by:
      setCancelled in interface org.bukkit.event.Cancellable
    • getHandlers

      @NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()
      Gets the handler list.
      Specified by:
      getHandlers in class org.bukkit.event.Event
      Returns:
      the handler list
    • getHandlerList

      public static org.bukkit.event.HandlerList getHandlerList()
      Gets the handler list.
      Returns:
      the handler list