use pocketmine\network\mcpe\handler\PacketHandler; class HurtArmorPacket extends DataPacket implements ClientboundPacket{ public const NETWORK_ID = ProtocolInfo::HURT_ARMOR_PACKET; /** @var int */ public $health; protected function decodePayload() : void{ $this->health = $this->buf->getVarInt(); } protected function encodePayload() : void{ $this->buf->putVarInt($this->health); } public function handle(PacketHandler $handler) : bool{ return $handler->handleHurtArmor($this); } }