How can I stop destroying farmland? I already tried something. But it didn't work. PHP: public function onBreak(BlockBreakEvent $e) {$e->setCancelled();} This only prevents a player from breaking the block :/
Use this: PHP: public function onBreak(BlockBreakEvent $e) { $block = $e->getBlock(); // Gets the block that gets broken // 60 is the Block ID of Farmland if($block->getId() === 60) { // Finds out if the Farmland (ID 60) is broken $e->setCancelled(); // Cancells the event }}
It only cancels the event if a player breaks the Farmland Block.That means it stops the player breaking Farmland.
SPOON USER! PMMP doesn't even have the feature, so you are either using a plugin or a spoon. Most likely the latter, so you cannot be helped here.
What he means is that PocketMine doesn't even have the trampling crops feature yet. Therefore, you shouldn't need to cancel it because it can't happen anyways. If it does happen to you, then you must be using a spoon.
i think they means are you sure farmlands break if you jump on it afaik i am not sure if this is a thing or not