On Server List Ping (Event) — Skript

Addon: Skript · Category: Event · Since: 2.3

Syntax

[on] server [list] ping

Description

Called when a server list ping is coming in, generally when a Minecraft client pings the server to show its information in the server list. The <a href='#ExprIP'>IP</a> expression can be used to get the IP adress of the pinger. This event can be cancelled on PaperSpigot 1.12.2+ only and this means the player will see the server as offline (but still can join).

Also you can use <a href='#ExprMOTD'>MOTD</a>, <a href='#ExprMaxPlayers'>Max Players</a>, <a href='#ExprOnlinePlayersCount'>Online Players Count</a>, <a href='#ExprProtocolVersion'>Protocol Version</a>, <a href='#ExprVersionString'>Version String</a>, <a href='#ExprHoverList'>Hover List</a> and <a href='#ExprServerIcon'>Server Icon</a> expressions, and <a href='#EffPlayerInfoVisibility'>Player Info Visibility</a> and <a href='#EffHidePlayerFromServerList'>Hide Player from Server List</a> effects to modify the server list.

Examples

on server list ping:
	set the motd to "Welcome %{player-by-IP::%ip%}%! Join now!" if {player-by-IP::%ip%} is set, else "Join now!"
	set the fake max players count to (online players count + 1)
	set the shown icon to a random server icon out of {server-icons::*}

View source