Class PlayerResourcePackStatusEvent

java.lang.Object
com.velocitypowered.api.event.player.PlayerResourcePackStatusEvent

public class PlayerResourcePackStatusEvent extends Object
This event is fired when the status of a resource pack sent to the player by the server is changed. Depending on the result of this event (which Velocity will wait until completely fired), the player may be kicked from the server.
  • Constructor Details

  • Method Details

    • getPlayer

      public Player getPlayer()
      Returns the player affected by the change in resource pack status.
      Returns:
      the player
    • getStatus

      Returns the new status for the resource pack.
      Returns:
      the new status
    • getPackInfo

      public @Nullable ResourcePackInfo getPackInfo()
      Returns the ResourcePackInfo this response is for.
      Returns:
      the resource-pack info or null if no request was recorded
    • isOverwriteKick

      public boolean isOverwriteKick()
      Gets whether or not to override the kick resulting from ResourcePackInfo.getShouldForce() being true.
      Returns:
      whether or not to overwrite the result
    • setOverwriteKick

      public void setOverwriteKick(boolean overwriteKick)
      Set to true to prevent ResourcePackInfo.getShouldForce() from kicking the player. Overwriting this kick is only possible on versions older than 1.17, as the client or server will enforce this regardless. Cancelling the resulting kick-events will not prevent the player from disconnecting from the proxy.
      Parameters:
      overwriteKick - whether or not to cancel the kick
      Throws:
      IllegalArgumentException - if the player version is 1.17 or newer
    • toString

      public String toString()
      Overrides:
      toString in class Object