gnembon / fabric-carpet

Fabric Carpet
MIT License
1.71k stars 273 forks source link

[scarpet] `unknown_sound` error when loading a custom sound in resource pack #1832

Closed szdytom closed 8 months ago

szdytom commented 11 months ago

I added sound minecraft:block.note_block.piano in a custom resource pack, and the sound works ok with /playsound command, but I got unknown_sound error when playing it using sound() function in Carpet Script.

ch-yx commented 11 months ago

why? is that because the the sound only exists on the client side?🤔

ch-yx commented 11 months ago

https://github.com/gnembon/fabric-carpet/blob/master/src/main/java/carpet/script/api/Auxiliary.java#L141-L144 could you please try removing those lines and see if that works?

or could you please share your pack so that i can test it?

szdytom commented 11 months ago

I'm playing in single-player, here is the resource pack: PianoMore.zip

Work:

/playsound minecraft:block.note_block.piano1 record @a ~ ~ ~ 1 1
/script run sound('minecraft:block.note_block.harp', player() ~ 'pos', 1, 1)

Don't work:

/script run sound('minecraft:block.note_block.piano1', player() ~ 'pos', 1, 1)

It's minecraft 1.20.1 with carpet v1.4.112+v230608.

ch-yx commented 11 months ago

seems that it got fixed by removing this try-catch about sound.

and about your pack there are some issues: 文件的路径名必须是小写并且不能有特殊符号。。。。你的文件名不仅有大写,还和别的文件的名字只有大小写的不同。。。我知道这个对于其他操作系统是可行的,但是我处理的时候真难受啊。。。。 The file pathname must be lowercase and cannot have special characters. . . . Not only does your file name have uppercase letters, it also differs from other file names only in uppercase and lowercase letters. . . I know this is possible in other os, but it's so painful for me to deal with. . . .

szdytom commented 11 months ago

Thanks. I think you should update Scarpet's document about sound() in #1834 as well.

ch-yx commented 11 months ago

好哒 做完啦

OK Done