Add command to check player health and saturation

This commit is contained in:
ReinforceZwei 2020-04-03 23:31:25 +08:00 committed by ORelio
parent fe020c74c7
commit 975e6d4daa
5 changed files with 31 additions and 8 deletions

View file

@ -725,10 +725,10 @@ namespace MinecraftClient.Protocol.Handlers
break;
case PacketIncomingType.UpdateHealth:
float health = dataTypes.ReadNextFloat(packetData);
// don't need them
dataTypes.ReadNextVarInt(packetData);
int Food = dataTypes.ReadNextVarInt(packetData);
// Food Saturation, not useful
dataTypes.ReadNextFloat(packetData);
handler.OnUpdateHealth(health);
handler.OnUpdateHealth(health, Food);
break;
default:
return false; //Ignored packet