Posted September 30, 20169 yr I have various sounds in my sounds.json and accessing them works usually well, but some of the objects in the json file have various sounds like: "mob.barbarian.hurt": { "category": "hostile", "sounds": [ { "name": "minecolonies:mob/barbarian/hurt1", "stream": false }, { "name": "minecolonies:mob/barbarian/hurt2", "stream": false }, { "name": "minecolonies:mob/barbarian/hurt3", "stream": false }, { "name": "minecolonies:mob/barbarian/hurt4", "stream": false } ] }, How may I register these? sound1 = registerSound("mob.barbarian.hurt.1"); sound1 = registerSound("mob.barbarian.hurt[1]"); I tried various of these but they didn't work. How do access these nested ones?
September 30, 20169 yr I haven't dealt with sounds in a LONG time, so don't qoute me on this. Right now you have 1 sound "object" in which you specify multiple sound files. This makes it, that whenever you play the sound, Minecraft selects a random sound specified in your sound "object". If you want to play these sounds yourself you have to make a new sound "object". EDIT: Apparently I was right Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support. 1.12 -> 1.13 primer by williewillus. 1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support. http://www.howoldisminecraft1710.today/
September 30, 20169 yr Hmmm. Lets see... "name": "minecolonies:mob/barbarian/hurt1" I wonder if this name means anything... registerSound("minecolonies:mob/barbarian/hurt1"); Ooooh...it does! Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
September 30, 20169 yr Author I thought the name attribute is only the file location and the "mob.babarian.hurt" is the identifier to register... Thanks then.
September 30, 20169 yr larsgerrits was correct: mob.barbarian.hurt is the name of your sound event, so use this in the ResourceLocation you pass to the SoundEvent constructor. minecolonies:mob/barbarian/hurt1 is the path to a sound file, which doesn't need to be registered. Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.
September 30, 20169 yr and then it will choose a random one from them? That's even better. Yes, that's the whole point of having a sound event contain multiple sound files. Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.