Class PlayerChannelUnregisterEvent
java.lang.Object
com.velocitypowered.api.event.player.PlayerChannelUnregisterEvent
Fired when a
Player unregisters one or more plugin channels from the proxy.
This event is triggered when the client sends a plugin message through the special "unregister" channel, indicating that it will no longer communicate over the specified plugin message channels.
Velocity dispatches this event asynchronously and will not wait for event listeners to complete before continuing with normal processing.
Note that plugin message registration and unregistration are part of the Minecraft plugin messaging protocol used to coordinate communication between the client, proxy, and backend servers.
- Since:
- 3.4.0
-
Constructor Summary
ConstructorsConstructorDescriptionPlayerChannelUnregisterEvent(Player player, List<ChannelIdentifier> channels) Constructs a newPlayerChannelUnregisterEvent. -
Method Summary
Modifier and TypeMethodDescriptionGets the list ofChannelIdentifiers that the player has unregistered.Gets thePlayerwho sent the unregister message.toString()Returns a string representation of this event, useful for debugging.
-
Constructor Details
-
PlayerChannelUnregisterEvent
Constructs a newPlayerChannelUnregisterEvent.- Parameters:
player- the player that sent the unregister messagechannels- the list ofChannelIdentifiers being unregistered- Throws:
NullPointerException- ifplayerorchannelsisnull
-
-
Method Details
-
getPlayer
Gets thePlayerwho sent the unregister message.- Returns:
- the player involved in this event
-
getChannels
Gets the list ofChannelIdentifiers that the player has unregistered.These identifiers correspond to the plugin message channels that the client has indicated it will no longer use.
- Returns:
- the list of unregistered channels
-
toString
Returns a string representation of this event, useful for debugging.
-