From 91d2eeebb7c03b22d6883c05ea7d33ba43482e79 Mon Sep 17 00:00:00 2001 From: DataModel <183248792+DataM0del@users.noreply.github.com> Date: Thu, 14 Nov 2024 12:38:32 -0600 Subject: [PATCH] fix(combat): players are getting kicked when attacking dead entities (#271) * fix(combat): kick players attacking dead players (health <= 0.0) --- pumpkin/src/client/player_packet.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pumpkin/src/client/player_packet.rs b/pumpkin/src/client/player_packet.rs index a425bd2ce..512f0064c 100644 --- a/pumpkin/src/client/player_packet.rs +++ b/pumpkin/src/client/player_packet.rs @@ -454,7 +454,11 @@ impl Player { .await; return; }; - + if victim.living_entity.health.load() <= 0.0 { + // you can trigger this from a non-modded / innocent client client, + // so we shouldn't kick the player + return; + } self.attack(&victim).await; } ActionType::Interact | ActionType::InteractAt => {