Jump to content

Gedeon

Members
  • Posts

    3
  • Joined

  • Last visited

Gedeon's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. I'm running into what I'm sure is a pretty novice issue but I cannot find the help that I need in past posts. I've created a mod that I've tested well on my local mc instance. However, it fails to load (server crashes on load) when trying to use it in on a brand new forge 1.19.2-43.2.0 server with a friend. The pain point is clearly a SoundInstance, and the only sound I've added is a custom song that plays upon entry to the nether (works fine on local mc). FML: 43.2 Forge: net.minecraftforge:43.2.0[22:36:38] [main/ERROR] [minecraft/Main]: Failed to start the minecraft server net.minecraftforge.fml.LoadingFailedException: Loading errors encountered: [ First Mod (firstmod) has failed to load correctly ?7java.lang.RuntimeException: Attempted to load class net/minecraft/client/resources/sounds/SoundInstance for invalid dist DEDICATED_SERVER ] As I understand from similar issues by folks in the modding community, this is due to a client mod/feature on the dedicated server? However, I have MANY server-side features, such as custom blocks, weapons, structures, etc. Any help would be much appreciated, thanks.
  2. Thank you for the feedback. Is another event subscription needed (onTick or other) to periodically call the isActive method? Could you please elaborate some more on your recommendation for a current instance of SoundInstance? Does this tie into the current subscription I have to PlaySoundEvent or something else?
  3. As the title suggests, I am trying to set (in this case override) the ambient music in the Nether with a custom song but cannot get looping to work. I have registered the .ogg file, set up correct configurations for a streamed sound in sounds.json and ensured everything is hooked up within the main mod file for the custom SoundEvent to be recognized. Which of event.setSound and play.playSound is needed? Is there a simple flag to do this or is there a more appropriate method/approach? @Mod.EventBusSubscriber(modid = FirstMod.MOD_ID) public static class ForgeEvents { @SubscribeEvent public static void onPlaySound(PlaySoundEvent event) { if (Minecraft.getInstance().player != null) { if (Minecraft.getInstance().level != null) { if (Minecraft.getInstance().level.dimension() == Level.NETHER) { LocalPlayer player = Minecraft.getInstance().player; if (!isCustomSongPlaying) { isCustomSongPlaying = true; event.setSound(SimpleSoundInstance.forLocalAmbience(ModSounds.CUSTOM_SONG.get(), 1.0f, 1.0f)); player.playSound(ModSounds.CUSTOM_SONG.get(), 1.0f, 1.0f); } } else { isCustomSongPlaying = false; } } } } }
×
×
  • Create New...

Important Information

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