Class PlayerResourcePackStatusEvent
java.lang.Object
com.velocitypowered.api.event.player.PlayerResourcePackStatusEvent
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.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Represents the possible statuses for the resource pack. -
Constructor Summary
ConstructorDescriptionPlayerResourcePackStatusEvent
(Player player, PlayerResourcePackStatusEvent.Status status) Deprecated.PlayerResourcePackStatusEvent
(Player player, PlayerResourcePackStatusEvent.Status status, ResourcePackInfo packInfo) Deprecated.Use(Player, UUID, Status, ResourcePackInfo)
instead.PlayerResourcePackStatusEvent
(Player player, UUID packId, PlayerResourcePackStatusEvent.Status status, ResourcePackInfo packInfo) Instantiates this event. -
Method Summary
Modifier and TypeMethodDescription@Nullable UUID
Returns the id of the resource pack.@Nullable ResourcePackInfo
Returns theResourcePackInfo
this response is for.Returns the player affected by the change in resource pack status.Returns the new status for the resource pack.boolean
Gets whether or not to override the kick resulting fromResourcePackInfo.getShouldForce()
being true.void
setOverwriteKick
(boolean overwriteKick) Set to true to preventResourcePackInfo.getShouldForce()
from kicking the player.toString()
-
Constructor Details
-
PlayerResourcePackStatusEvent
@Deprecated public PlayerResourcePackStatusEvent(Player player, PlayerResourcePackStatusEvent.Status status) Deprecated.Use(Player, UUID, Status, ResourcePackInfo)
instead.Instantiates this event. -
PlayerResourcePackStatusEvent
@Deprecated public PlayerResourcePackStatusEvent(Player player, PlayerResourcePackStatusEvent.Status status, ResourcePackInfo packInfo) Deprecated.Use(Player, UUID, Status, ResourcePackInfo)
instead.Instantiates this event. -
PlayerResourcePackStatusEvent
public PlayerResourcePackStatusEvent(Player player, UUID packId, PlayerResourcePackStatusEvent.Status status, ResourcePackInfo packInfo) Instantiates this event.
-
-
Method Details
-
getPlayer
Returns the player affected by the change in resource pack status.- Returns:
- the player
-
getPackId
Returns the id of the resource pack.- Returns:
- the id
-
getStatus
Returns the new status for the resource pack.- Returns:
- the new status
-
getPackInfo
Returns theResourcePackInfo
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 fromResourcePackInfo.getShouldForce()
being true.- Returns:
- whether or not to overwrite the result
-
setOverwriteKick
public void setOverwriteKick(boolean overwriteKick) Set to true to preventResourcePackInfo.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
-
(Player, UUID, Status, ResourcePackInfo)
instead.