Guide for server owners
Count Joins From the Server List With a Dedicated Address
Updated
The numbers on our advertise page come from our own tracking: how often players copied a server address and how many pages they viewed. If you want a count of your own, give the list its own address. Every player who copies it from MinecraftServers.me joins with that hostname, and your proxy or server can log it. This guide shows how to set that up in a few minutes.
1. Create a dedicated hostname
Add a new DNS name that only this list uses, for example msme.play.example.com, and point it at the same server as your main address:
- A record to the same IP address as your main address, or a CNAME to your main hostname (
play.example.com). - SRV record if your server does not run on port 25565:
_minecraft._tcp.msme.play.example.comwith your port. Give the SRV record a dedicated target as well (for examplemsme-target.play.example.comwith its own A record): depending on the client, the hostname sent to your server can be the SRV target rather than the name the player typed. - On Cloudflare, set the record to DNS only. The proxied (orange cloud) mode only carries web traffic and players will not be able to connect.
2. List that address
Open your server in the dashboard, edit it and enter the dedicated hostname as the Java address. Crossplay servers can do the same for the Bedrock address with a second name, such as msme-bedrock.play.example.com.
The address has to keep working for as long as it is listed. Our status checker pings the listed address every few minutes; if the name stops resolving, your listing shows as offline and players who copied it cannot join. Status pings are not logins, so they never show up in the join counts below.
3. Log the hostname on join
When a Java client connects, the first packet it sends (the handshake) contains the hostname it connected with. Proxies and servers hand that hostname to plugins, so a listener of a few lines can write it to the console log. If you run a proxy, add it there: the proxy is what players connect to.
Velocity
Player#getVirtualHost() returns the hostname and port the player used.
@Subscribe
public void onPostLogin(PostLoginEvent event) {
Player player = event.getPlayer();
String host = player.getVirtualHost()
.map(InetSocketAddress::getHostString)
.orElse("unknown");
logger.info("join-host {} {}", player.getUsername(), host);
}BungeeCord and Waterfall
PendingConnection#getVirtualHost() holds the same value.
@EventHandler
public void onPostLogin(PostLoginEvent event) {
ProxiedPlayer player = event.getPlayer();
InetSocketAddress host = player.getPendingConnection().getVirtualHost();
getLogger().info("join-host " + player.getName() + " "
+ (host == null ? "unknown" : host.getHostString()));
}Paper or Spigot without a proxy
PlayerLoginEvent#getHostname() returns the hostname the player used, including the port.
@EventHandler
public void onLogin(PlayerLoginEvent event) {
getLogger().info("join-host " + event.getPlayer().getName() + " " + event.getHostname());
}Modded clients can append extra data after the hostname, so always match on the hostname itself rather than on the whole value.
4. Count the joins
Every join now leaves a line ending in the player name and the hostname. On Paper, Velocity and Waterfall the current log is logs/latest.log and older days are rotated into .log.gz files next to it; BungeeCord writes to proxy.log.0 instead.
# Joins on the dedicated address in today's log
grep "join-host" logs/latest.log | grep -c "msme.play.example.com"
# Different players behind those joins
grep "join-host" logs/latest.log | grep "msme.play.example.com" \
| awk '{print $(NF-1)}' | sort -u | wc -l
# The same over the rotated logs of earlier days
zgrep -h "join-host" logs/*.log.gz | grep "msme.play.example.com" \
| awk '{print $(NF-1)}' | sort -u | wc -lPlayers keep the address in their multiplayer list, so the count includes returning players as well as first joins. The number of different player names is the better measure of how many people the listing brought you. Some players also pass the address on to friends, which is still the listing at work.
Bedrock players through Geyser
Bedrock clients also tell the server which address they connected to. Geyser passes it on to the Java side when the forward-hostname option in its config.yml is set to true, so the same listener on your proxy sees the Bedrock hostname too. List a dedicated Bedrock name and count it the same way.
Compare with our numbers
Our advertise page shows the IP copies and page views of the last 30 days across the whole list, and your dashboard shows the copies for your own server per day. Not every copy turns into a join, so expect your first-time joins to be lower than your copies.