Minecraft Vanilla server – Test if a player is lagging

minecraft-java-editionminecraft-java-edition-server

I was just wondering if there was a way I could test if a player is having lag issues while playing. This is a very important feature, because players that are lagging are susceptible to a false ban by the command block anticheat. I am trying things out such as setting their Alive score to 0, and adding 1 to it every tick, I've also tried this with the Alive objective being stat.timeSinceLastDeath

I thought this would work, because when a the player/server is lagging, the scores don't properly add/set. (not just client side, also server side) I guess the real question is: How can I test if a player's objective score stops incrementing? Because, in theory, if the player's score stops incrementing, then they or the server are lagging.

Best Answer

As far as i now, the scoreboard is completly server side. So you cant check if the player is lagging.

You can see how good the ping of a player is by pressing tab.

There is a way seeing the exact ping of a player is kind of hard:

  1. Look into the server console a search for the ip of the player

[time] [Server thread/INFO]: player[/127.0.0.1:52288] logged in

  1. Once you have ping the player by typing ping [ip] (on windows)

127.0.0.1: Bytes=32 Time<1ms TTL=128

Hope it helped a little bit.