ServerListPingEvent
and modify the ResponseData
in the event. Regardless of the source of the ping, the response data will be formatted in the correct way for the corrosponding source.ServerListPingType
enum. The type can be obtained from the ServerListPingEvent
using the getPingType()
method. This allows you to change your responses based on the incoming ping, allowing you to only fill in the information that is needed or customise the response based on the type of ping.ServerListPingEvent
can be broken down into three different categories.MODERN_FULL_RGB
and MODERN_NAMED_COLORS
constants, this category represents the most common type of response and is used on Minecraft versions 1.7 and higher. This includes the name, protocol, version, description, favicon, number of players online, max number of players online and a sample of the online players.NamedAndIdentified
interface is used to hold this mapping and allow both players and custom mappings to be used interchangeably in the ResponseData
class. For an example on how to use this interface, see the code block below.???
LEGACY_VERSIONED
and LEGACY_UNVERSIONED
constants, this category represents server list pings that are sent by clients on version 1.6 or lower. These ping types only support the description and the current/max number of players. The LEGACY_VERSIONED
type additionally supports the version of the server.OPEN_TO_LAN
constant, this category represents server list pings that are sent from the server when it is mimicking being a single player world that is opened to LAN. This type only supports the description. As with the legacy type, the description is formatted using legacy section sign color coding and is automatically converted to this format.ClientPingServerEvent
for this.ServerListPingEvent
, the underlying PlayerConnection
is accessible.