Sound)) $nbt->Sound = new StringTag("Sound", self::SOUND(rand(0, count(self::SOUNDS) - 1))); // TODO: Customize the sound parent::__construct($chunk, $nbt); } /* Sets the sound of the Block @param $sound string @return bool */ public function setSound(string $sound) : bool { if(in_array($sound, self::SOUNDS)) { $this->namedtag->Sound->setValue($sound); return true; } return false;; } /* Gets the current used sound @return string */ public function getSound() : string { return $this->namedtag->Sound->getValue(); } /* Plays the sound */ public function play() { $s = "\\pocketmine\\level\\sound\\" . $this->namedtag->Sound->getValue(); $this->getLevel()->addSound(new $s($this)); } }