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.

Supersaver

Members
  • Joined

  • Last visited

Everything posted by Supersaver

  1. Hi everyone, I’m working on a Minecraft mod and encountering an issue with a custom sound not playing when triggered. Here’s the setup: Problem: * A custom sound (killstreak_music) should play when a milestone (5 kills) is reached, but it doesn’t trigger in-game. * The .ogg file is in the correct directory (assets/killstreaksword/sounds/) and registered in sounds.json. sounds.json: { "killstreak_music": { "sounds": ["Finale.ogg"] } } The .ogg file plays fine in other media players, but the /playsound command doesn’t detect it. What I’ve Tried: * Confirmed file path and name match exactly. * Reloaded resources (F3 + T) and re-exported the file using Audacity. * Added debug logs to my code to verify if the sound event is being retrieved. Here’s the relevant part of my code where I attempt to play the sound: private static final ResourceLocation SOUND_LOCATION = ResourceLocation.fromNamespaceAndPath("killstreaksword", "killstreak_music"); private void playKillstreakMusic(Level world, Player player) { SoundEvent soundEvent = ForgeRegistries.SOUND_EVENTS.getValue(SOUND_LOCATION); if (soundEvent == null) { System.out.println("Sound event not found: " + SOUND_LOCATION); } else { world.playSound(null, player.getX(), player.getY(), player.getZ(), soundEvent, SoundSource.PLAYERS, 1.0F, 1.0F); } } Could this be a file encoding or registration issue? Are there additional steps I’m missing to ensure Minecraft detects the sound? Any guidance or suggestions would be greatly appreciated. Thanks in advance!

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.