use pocketmine\network\mcpe\handler\PacketHandler; class ScriptCustomEventPacket extends DataPacket{ //TODO: this doesn't have handlers in either client or server in the game as of 1.8 public const NETWORK_ID = ProtocolInfo::SCRIPT_CUSTOM_EVENT_PACKET; /** @var string */ public $eventName; /** @var string json data */ public $eventData; protected function decodePayload() : void{ $this->eventName = $this->getString(); $this->eventData = $this->getString(); } protected function encodePayload() : void{ $this->putString($this->eventName); $this->putString($this->eventData); } public function handle(PacketHandler $handler) : bool{ return $handler->handleScriptCustomEvent($this); } }