Class PartyInviteEvent

java.lang.Object
org.bukkit.event.Event
dev.itsharshxd.zentrix.api.events.ZentrixEvent
dev.itsharshxd.zentrix.api.events.party.PartyInviteEvent
All Implemented Interfaces:
org.bukkit.event.Cancellable

public final class PartyInviteEvent extends ZentrixEvent implements org.bukkit.event.Cancellable
Called when a party leader invites a player, after Zentrix's own checks passed and before the invitation is stored or anyone is messaged.

Cancel to refuse the invitation; Zentrix sends no message then, so explain it to the leader if needed. The expiry can be changed within 5 to 3600 seconds. Main thread; only fired while a listener is registered.

Since:
1.8.0
  • Field Details

    • MIN_EXPIRATION_SECONDS

      public static final int MIN_EXPIRATION_SECONDS
      The shortest expiry a listener may set.
      See Also:
    • MAX_EXPIRATION_SECONDS

      public static final int MAX_EXPIRATION_SECONDS
      The longest expiry a listener may set.
      See Also:
  • Constructor Details

    • PartyInviteEvent

      public PartyInviteEvent(@NotNull @NotNull ZentrixParty party, @NotNull @NotNull UUID inviterId, @NotNull @NotNull UUID inviteeId, int expirationSeconds)
  • Method Details

    • getParty

      @NotNull public @NotNull ZentrixParty getParty()
      The inviting party.
    • getInviterId

      @NotNull public @NotNull UUID getInviterId()
      The leader sending the invitation.
    • getInviteeId

      @NotNull public @NotNull UUID getInviteeId()
      The invited player.
    • getExpirationSeconds

      public int getExpirationSeconds()
      Seconds until the invitation expires; the configured expiry unless a listener changed it.
    • setExpirationSeconds

      public void setExpirationSeconds(int seconds)
      Changes how long the invitation stays open.
      Parameters:
      seconds - the expiry, clamped to 5..3600
    • isCancelled

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

      public void setCancelled(boolean cancelled)
      Specified by:
      setCancelled in interface org.bukkit.event.Cancellable
    • 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()