isFullBlock = false; $this->isActivable = true; $this->meta = $meta & 0x07; } public function onUpdate($type){ if($type === BLOCK_UPDATE_NORMAL){ if($this->getSide(0)->getID() === AIR){ //Replace wit common break method $this->level->setBlock($this, new AirBlock(), false); return BLOCK_UPDATE_NORMAL; } } return false; } public function getDrops(Item $item, Player $player){ return array(); } public function onActivate(Item $item, Player $player){ if($player->entity->getHealth() < 20){ ++$this->meta; $player->entity->heal(3, "cake"); if($this->meta >= 0x06){ $this->level->setBlock($this, new AirBlock()); }else{ $this->level->setBlock($this, $this); } return true; } return false; } }