gnembon / fabric-carpet

Fabric Carpet
MIT License
1.73k stars 275 forks source link

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

Closed szdytom closed 10 months ago

szdytom commented 1 year 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.

17183248569 commented 1 year ago

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

17183248569 commented 1 year 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 1 year 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.

17183248569 commented 1 year 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 1 year ago

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

17183248569 commented 1 year ago

好哒 做完啦

OK Done