import*as mc from"@minecraft/server";export function start(s){const o=getPlayers(s);for(let s of o)s.isValid()&&s.runCommand("/playsound hf_mzs:music.sculptor.start @s ~ ~ ~ 0.5 1 0.5")}export function startLoop(s){mc.system.runTimeout((()=>{const o=getPlayers(s);for(let s of o)s.runCommand("/stopsound @s hf_mzs:music.sculptor.start"),loopMusic(s)}),2)}export function loopMusic(s){s.isValid()&&(s.runCommand("/stopsound @s hf_mzs:music.sculptor.music"),s.runCommand("/playsound hf_mzs:music.sculptor.music @s ~ ~ ~ 0.5 1 0.5"),mc.system.runTimeout((()=>{s.hasTag("hf_mzs_sculptor_test")&&loopMusic(s)}),2560))}export function end(s,o){mc.system.run((()=>{s?.runCommand("/stopsound @a[r=64] hf_mzs:music.sculptor.music")}));const t=getPlayers(s);for(let m of t)m?.isValid()&&(o&&m?.runCommand("/playsound hf_mzs:music.sculptor.outro @s ~ ~ ~ 0.5 1 0.5"),s?.setDynamicProperty("hf_mzs:playing_outro",!0))}function getPlayers(s){return s&&s.isValid()?s.dimension.getEntities({maxDistance:64,families:["player"],location:s.location}):[]}