22declare(strict_types=1);
41 public function onBreak(
Item $item, ?
Player $player =
null, array &$returnedItems = []) : bool{
42 if(($player === null || $player->isSurvival()) && !$item->hasEnchantment(
VanillaEnchantments::SILK_TOUCH())){
43 $this->position->getWorld()->setBlock($this->position, VanillaBlocks::WATER());
46 return parent::onBreak($item, $player, $returnedItems);
54 $world = $this->position->getWorld();
55 if($world->getHighestAdjacentBlockLight($this->position->x, $this->position->y, $this->position->z) >= 12){
56 BlockEventHelper::melt($this, VanillaBlocks::WATER());
onBreak(Item $item, ?Player $player=null, array &$returnedItems=[])
getDropsForCompatibleTool(Item $item)