From 9055a6133e15d22736e34a20ca2679d1d9b87b63 Mon Sep 17 00:00:00 2001 From: Alexander Medvedev Date: Wed, 24 Jun 2026 21:12:27 +0200 Subject: [PATCH] fix: respawn packet data --- pumpkin-protocol/src/java/client/play/respawn.rs | 4 ++++ pumpkin/src/entity/player.rs | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pumpkin-protocol/src/java/client/play/respawn.rs b/pumpkin-protocol/src/java/client/play/respawn.rs index 071b37aa2..610962a19 100644 --- a/pumpkin-protocol/src/java/client/play/respawn.rs +++ b/pumpkin-protocol/src/java/client/play/respawn.rs @@ -15,6 +15,10 @@ pub struct CRespawn { } impl CRespawn { + pub const KEEP_ATTRIBUTE_MODIFIERS: u8 = 1; + pub const KEEP_ENTITY_DATA: u8 = 2; + pub const KEEP_ALL_DATA: u8 = 3; + #[must_use] pub const fn new(player_spawn_info: PlayerSpawnData, data_kept: u8) -> Self { Self { diff --git a/pumpkin/src/entity/player.rs b/pumpkin/src/entity/player.rs index 19634cad3..70e231d00 100644 --- a/pumpkin/src/entity/player.rs +++ b/pumpkin/src/entity/player.rs @@ -2510,14 +2510,14 @@ impl Player { new_world.dimension.clone(), biome::hash_seed(new_world.level.seed.0), // seed self.gamemode.load() as u8, - self.gamemode.load() as i8, + self.previous_gamemode.load().unwrap_or(self.gamemode.load()) as i8, false, false, Some((death_dimension, death_location)), VarInt(self.get_entity().portal_cooldown.load(Ordering::Relaxed) as i32), new_world.sea_level.into(), ), - 1, + CRespawn::KEEP_ALL_DATA, )).await; self.send_permission_lvl_update();