You can add sound using plugin and PlayerInteractEvent. PHP: public function onTouch(PlayerInteractEvent $e) { $p = $e->getPlayer(); if($e->getBlock()->getId() == Block::NOTEBLOCK) { $p->getLevel()->addSound(new NoteblockSound($p,NoteblockSound::INSTRUMENT_PIANO,rand(1,10)),[$p]); } }
If you want use nbt music dont do this: I think noteblock is working he meant noteblock not working when trying to use .nbt
NoteblockSound isn't an actual class... Try this: PHP: public function onTouch(PlayerInteractEvent $e) { $p = $e->getPlayer(); if($e->getBlock()->getId() === Block::NOTEBLOCK) { $p->getLevel()->addSound(new GenericSound($e->getBlock(), LevelSoundEventPacket::SOUND_NOTE, rand(1,10)), $p->getLevel()->getPlayers()); } }