Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

I have the following sounds.json file in my mod's src/main/resources/assets/minecraft directory:

{
	"entity.endermen.stare": {
		"replace": true,
		"sounds": ["btweagles:beejdrop"]
	},
	"entity.endermen.scream": {
		"replace": true,
		"sounds": ["btweagles:beejdrop"]
	}
}

 

As I understand it, every mod is also a resource pack, and according to the official wiki, "unlike most other files in resource packs, sounds.json will merge sound information from packs below the top pack, rather than each sounds.json file overriding the previous completely." Given that, I would expect that only the two SoundEvents I have listed would be replaced, and all other vanilla sounds would be unaffected.

However, this does not appear to be the case. Instead, I'm met with a litany of warnings when Minecraft starts up:

[main/WARN]: Missing sound for event: minecraft:ambient.cave
[main/WARN]: Missing sound for event: minecraft:block.anvil.break
[main/WARN]: Missing sound for event: minecraft:block.anvil.destroy
[main/WARN]: Missing sound for event: minecraft:block.anvil.fall
[main/WARN]: Missing sound for event: minecraft:block.anvil.hit
[main/WARN]: Missing sound for event: minecraft:block.anvil.land
[main/WARN]: Missing sound for event: minecraft:block.anvil.place
[main/WARN]: Missing sound for event: minecraft:block.anvil.step
...

And indeed no sounds play except for those I've explicitly defined in my sounds.json file.

Does this mean I have to replicate the entire vanilla sounds.json in order to replace just a few sound files, or is there a more modder-friendly way to do it?

  • Author

I was under the impression that it had to be in the "minecraft" domain in order to affect vanilla SoundEvents. Is that not correct?

Vanilla is already supplying a sounds.json at that location.

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.

SoundHandler#onResourceManagerReload explicitly iterates through every copy of sounds.json for each domain (using IResourceManager#getAllResources), it doesn't just use first one it finds (using IResourceManager#getResource) like most other places in the code do.

 

Looking at the code, it should only replace the sounds present in each sounds.json file (that opt-in to replace existing sounds); I'm not sure why the other sounds are being removed.

 

Try setting a breakpoint in SoundHandler#onResourceManagerReload and stepping through the code.

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.

  • Author

Hm, interesting. Assuming I'm understanding this correctly, it appears that DefaultResourcePack#getResourceStream is somehow finding a copy of my sounds.json file (located at file:/H:/projects/BetterThanWeagles/out/production/BetterThanWeagles_main/assets/minecraft/sounds.json) instead of the vanilla one. This is causing my sounds.json to get loaded twice (redundantly) and the vanilla sounds to not load at all.

Edited by DarkMorford

I guess it shouldn't be in minecraft domain. It should under the domain for your own mod, i.e. assets/(modid)/sounds.json.

Because the assets folder is to be merged.

I. Stellarium for Minecraft: Configurable Universe for Minecraft! (WIP)

II. Stellar Sky, Better Star Rendering&Sky Utility mod, had separated from Stellarium.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.