Drop the cursor stack when the dead player respawns

This commit is contained in:
Kacpherek
2026-10-26 19:46:01 +01:00
parent e6587dce6a
commit 8aad511579
@@ -290,6 +290,14 @@ impl Game<'_> {
/// button, or at once with `immediate_respawn`).
pub(super) fn respawn_player(&mut self) -> Result<()> {
if self.remote.is_none() {
// PlayerList.respawn removes the dead player, and Player.remove's
// inventoryMenu.removed drops what the cursor held, whatever
// keep_inventory says (the 20-tick branch handles a later respawn).
if let Some(stack) = self.carried.take()
&& let Some(eye) = self.eye_position()
{
self.throw_from_eyes(stack, eye);
}
let keep = self.ui.rules.bool("keep_inventory") || self.spectator();
self.experience.respawn(keep);
// The guests are sent the respawned host as a new entity, not the dead body.