player = $player; $this->item = $item; $this->hotbarSlot = $hotbarSlot; } /** * Returns the hotbar slot the player is attempting to hold. * * NOTE: This event is called BEFORE the slot is equipped server-side. Setting the player's held item during this * event will result in the **old** slot being changed, not this one. * * To change the item in the slot that the player is attempting to hold, set the slot that this function reports. * * @return int */ public function getSlot() : int{ return $this->hotbarSlot; } /** * Returns the item in the slot that the player is trying to equip. * * @return Item */ public function getItem() : Item{ return $this->item; } }