From fc2e104c418bf149a8d279033ddb1b2002c2ccbd Mon Sep 17 00:00:00 2001 From: GameHerobrine Date: Wed, 16 Jul 2025 14:41:27 +0300 Subject: [PATCH] hotbar is full of air in spectator mode now --- src/Player.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Player.php b/src/Player.php index ad226049..44a61f57 100755 --- a/src/Player.php +++ b/src/Player.php @@ -1535,7 +1535,7 @@ class Player{ } if($this->sendingInventoryRequired){ - if(($this->gamemode & 0x01) !== CREATIVE){ + if($this->gamemode !== CREATIVE){ $hotbar = []; foreach($this->hotbar as $slot){ $hotbar[] = $slot <= -1 ? -1 : $slot + 9; @@ -2380,7 +2380,12 @@ class Player{ } $data["slot"] = $packet->slot; - + + if($this->gamemode == VIEW && $packet->item != AIR){ + $this->sendInventory(); + break; + } + if($this->server->handle("player.equipment.change", $data) !== false){ if(!Player::$experimentalHotbar) $this->slot = $packet->slot; if(($this->gamemode & 0x01) === SURVIVAL){