Class TimedTierGrantEvent

java.lang.Object
org.bukkit.event.Event
dev.itsharshxd.zentrix.api.events.ZentrixEvent
dev.itsharshxd.zentrix.api.events.perk.TimedTierGrantEvent

public final class TimedTierGrantEvent extends ZentrixEvent
Called after a player was given a tier for a time, such as with /zx perks grant, and the grant was stored. Given again before it ends, the time is added to what was left, and getExpiresAt() is the new end.

Main thread, on the server that made the grant; the player may be offline. Only fired while a listener is registered.

Since:
1.16.0
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.bukkit.event.Event

    org.bukkit.event.Event.Result
  • Constructor Summary

    Constructors
    Constructor
    Description
    TimedTierGrantEvent(@NotNull UUID playerId, @NotNull String tierId, @Nullable PerkTier tier, @NotNull Instant expiresAt, @NotNull String source)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull Instant
    When the grant ends.
    static @NotNull org.bukkit.event.HandlerList
     
    @NotNull org.bukkit.event.HandlerList
    Gets the handler list for this event.
    @NotNull Optional<org.bukkit.entity.Player>
    The player, while online on this server.
    @NotNull UUID
     
    @NotNull String
    Who or what gave it, such as an administrator's name or console.
    @NotNull Optional<PerkTier>
    The tier, or empty while it is disabled, which gives nothing until it is enabled.
    @NotNull String
    The tier's ID in perks.yml.

    Methods inherited from class org.bukkit.event.Event

    callEvent, getEventName, isAsynchronous

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • TimedTierGrantEvent

      public TimedTierGrantEvent(@NotNull @NotNull UUID playerId, @NotNull @NotNull String tierId, @Nullable @Nullable PerkTier tier, @NotNull @NotNull Instant expiresAt, @NotNull @NotNull String source)
  • Method Details

    • getPlayerId

      @NotNull public @NotNull UUID getPlayerId()
    • getPlayer

      @NotNull public @NotNull Optional<org.bukkit.entity.Player> getPlayer()
      The player, while online on this server.
    • getTierId

      @NotNull public @NotNull String getTierId()
      The tier's ID in perks.yml.
    • getTier

      @NotNull public @NotNull Optional<PerkTier> getTier()
      The tier, or empty while it is disabled, which gives nothing until it is enabled.
    • getExpiresAt

      @NotNull public @NotNull Instant getExpiresAt()
      When the grant ends.
    • getSource

      @NotNull public @NotNull String getSource()
      Who or what gave it, such as an administrator's name or console.
    • getHandlers

      @NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()
      Description copied from class: ZentrixEvent
      Gets the handler list for this event.
      Overrides:
      getHandlers in class ZentrixEvent
      Returns:
      The handler list
    • getHandlerList

      @NotNull public static @NotNull org.bukkit.event.HandlerList getHandlerList()