From 0fde30fc78f05ad97d9aa278ebc4283187f10e22 Mon Sep 17 00:00:00 2001 From: Camotoy <20743703+DoctorMacc@users.noreply.github.com> Date: Sat, 8 Aug 2020 17:50:49 -0400 Subject: [PATCH] GeyserSession: always send naturalRegeneration=false gamerule (#1097) This essentially gives the server full control over the health visual. --- .../geysermc/connector/network/session/GeyserSession.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/connector/src/main/java/org/geysermc/connector/network/session/GeyserSession.java b/connector/src/main/java/org/geysermc/connector/network/session/GeyserSession.java index 5378900d..340292e2 100644 --- a/connector/src/main/java/org/geysermc/connector/network/session/GeyserSession.java +++ b/connector/src/main/java/org/geysermc/connector/network/session/GeyserSession.java @@ -249,6 +249,12 @@ public class GeyserSession implements CommandSender { attributes.add(new AttributeData("minecraft:movement", 0.0f, 1024f, 0.1f, 0.1f)); attributesPacket.setAttributes(attributes); upstream.sendPacket(attributesPacket); + + // Only allow the server to send health information + // Setting this to false allows natural regeneration to work false but doesn't break it being true + GameRulesChangedPacket gamerulePacket = new GameRulesChangedPacket(); + gamerulePacket.getGameRules().add(new GameRuleData<>("naturalregeneration", false)); + upstream.sendPacket(gamerulePacket); } public void login() {