I've been meaning to report this issue for⦠almost a year now, but things kept coming up and I kept forgetting l o l
β» Disclaimer: I haven't actually looked too closely at DeathLog's code to see how it's detecting player deaths, and also most of my Minecraft dev experience lies with server-side Bukkit plugins instead of client-side Fabric/Forge mods.
Description
The current mechanisms of detecting deaths that DeathLog is using (ServerPlayerEntityMixin
and ClientPlayNetworkHandlerMixin
) do not work with certain types of servers, notably old legacy servers put through some kind of protocol translator, like ViaVersion(ViaFabric)/VIAaaS/ViaProxy.
You can test this by connecting to something like the Glowstone Test Server (mc.glowstone.net
, native protocol version 1.12.2), killing yourself, and seeing how DeathLog fails to detect the death event.
This is reproducible across all DeathLog versions from 0.2.10 (1.19.2γ1.19) all the way down to 0.1.2 (1.16.5γ1.16.2).
Proposed solution
I think it would be a good idea to consider adding an additional player death detection mechanism, and OR'ing it (not replacing it, see below as to why) with the current mechanism in order to get around this.
Specifically, since the death screen usually always appears upon death (the only time when it doesn't is if the doImmediateRespawn
gamerule is set to true
), hooking net.minecraft.client.gui.screens.DeathScreen
would probably be a solution for detecting deaths that ServerPlayerEntityMixin
fails to detect.
It would also probably be good to add a check for a HealthUpdateS2CPacket
sent from the server with a value of 0
, since this is another method of triggering deaths used by legacy servers.
It may also be worth taking a look at whatever DeathFinder (MPL2.0-licensed) is doing for its player death detection mechanism, since I know that definitely works for the servers above as I sometimes use it in combination with DeathLog as a workaround to at least get coordinates on the death screen when playing on these kind of servers. ;P (I haven't really looked at their code yet, though.)