Skip to content

Commit

Permalink
fix(combat): players are getting kicked when attacking dead entities (#…
Browse files Browse the repository at this point in the history
…271)

* fix(combat): kick players attacking dead players (health <= 0.0)
  • Loading branch information
DataM0del authored Nov 14, 2024
1 parent 1ae9c99 commit 91d2eee
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pumpkin/src/client/player_packet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down

0 comments on commit 91d2eee

Please sign in to comment.