Hi! I please edit this code on my plugin PHP: <?phpnamespace dragonflex;use pocketmine\plugin\PluginBase as PluginBase;use pocketmine\event\Listener as Listener;use pocketmine\utils\TextFormat;use pocketmine\scheduler\PluginTask;use pocketmine\event\block\BlockBreakEvent;use pocketmine\block\Block;use pocketmine\math\Vector3;use pocketmine\item\Item;class Main extends PluginBase implements Listener{ public function onEnable(){ $this->getServer()->getPluginManager()->registerEvents($this,$this); $this->getServer()->getLogger()->info(TextFormat::GREEN."[Stoniarka] Plugin stworzony przez dragonflex"); } public function onBreak(BlockBreakEvent $event){ $blok = $event->getBlock(); $gracz = $event->getPlayer(); $y = $blok->getFloorY(); $x = $blok->getFloorX(); $z = $blok->getFloorZ(); if($this->plugin->time($gracz)) { if(time() - $this->plugin->getTIMETime($gracz) > 3) { if($blok->getId() == 1){ if($gracz->getLevel()->getBlock(new Vector3($x, $y-1, $z))->getId() == 121) { $event->setCancelled(); $gracz->getInventory()->addItem(Item::get(4, 0, 1)); } } } }}}
<?php namespace stoniarka\stoniarka; use pocketmine\scheduler\PluginTask; class MyTask extends PluginTask { /** * * @param MyTask $owner */ public function __construct(MyTask $owner) { parent::__construct ( $owner ); } public function onRun($currentTick) { /** * @var $owner MyTask */ $owner = $this->getOwner (); $owner->tick (); } } Mian.php Add : $this->getServer ()->getScheduler ()->scheduleRepeatingTask ( new cstoniarka ( $this ), 20 ); $this->getServer ()->getPluginManager ()->registerEvents ( $this, $this );