pocketmine\block\Noteblock::onActivate PHP Method

onActivate() public method

public onActivate ( Item $item, Player $player = null )
$item pocketmine\item\Item
$player pocketmine\Player
    public function onActivate(Item $item, Player $player = null)
    {
        $up = $this->getSide(Vector3::SIDE_UP);
        if ($up->getId() == 0) {
            $this->getLevel()->addSound(new NoteblockSound($this, $this->getInstrument(), $this->getStrength()));
            return true;
        } else {
            return false;
        }
    }