It check first tap on block before start breaking, but i want start check it when start breaking block
Try PHP: public $breaks;public function onInteract(PlayerInteractEvent $e) { $this->breaks = true}public function onBreak(BlockBreakEvent $e) { $this->breaks = false;} In task you can use PHP: $breaking = $this->plugin->breaks;
You can use this https://github.com/iTXTech/Genisys/blob/master/src/pocketmine/Player.php#L2680 PlayerActionPacket::ACTION_START_BREAK and PlayerActionPacket::ACTION_ABORT_BREAK
set player gamemode to adventure and then to their gamemode before setting adventure to cancel block breaking if i use blockbreak event hackers can bug out from map on server
you should just set gamemode to adventure on block break, then fire a delayed task to re set the player's gamemode
Ok, i used player interact packet and re seted player gamemode in task. Thanks robske_110(Tim) and Thunder33345