My code PHP: public function onDataPacketReceive(DataPacketReceiveEvent $event){ $packet = $event->getPacket(); //var_dump("Class: ".get_class($packet)." pid: ".$packet->pid());if($packet->pid() == Info::PLAYER_ACTION_PACKET){var_dump("ACTION: ".$packet->action);$event->setCancelled();var_dump("EVENT: ".($event->isCancelled()));var_dump("PACKET");var_dump(($packet));} }} I expect that it cancels that the block even gets destroyed, but no, it doesnt work anyways, even if I change the coordinates of the packet or set the event cancelled... How can I cancel that event?
You should never use data packet receives for stuff like this because all you're doing is adding extra overhead before other unrelated packets can be processed.
Actually, sometimes packet events are the way to go. I normally use these events for debugging, not for actual functionality.