use pocketmine\network\mcpe\NetworkSession; class MobEffectPacket extends DataPacket{ const NETWORK_ID = ProtocolInfo::MOB_EFFECT_PACKET; const EVENT_ADD = 1; const EVENT_MODIFY = 2; const EVENT_REMOVE = 3; public $eid; public $eventId; public $effectId; public $amplifier = 0; public $particles = true; public $duration = 0; public function decode(){ $this->eid = $this->getEntityRuntimeId(); $this->eventId = $this->getByte(); $this->effectId = $this->getVarInt(); $this->amplifier = $this->getVarInt(); $this->particles = $this->getBool(); $this->duration = $this->getVarInt(); } public function encode(){ $this->reset(); $this->putEntityRuntimeId($this->eid); $this->putByte($this->eventId); $this->putVarInt($this->effectId); $this->putVarInt($this->amplifier); $this->putBool($this->particles); $this->putVarInt($this->duration); } public function handle(NetworkSession $session) : bool{ return $session->handleMobEffect($this); } }