Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[1.11.2] Adding game music


CeperaProduction
 Share

Recommended Posts

Hi guys. I want to add some custom music to game (Im talking about music, that plaing randomly on background), but i don't know how i can do this. I was searching for some information about it and had found that some peoples were talking about SoundPool. But all these posts were about MC version 1.7.10 and lower. Where I can find something like SoundPool in 1.11.2 and how I can edit it to add my own music and maybe remove or replace some vanilla sounds?

Edited by CeperaProduction
Link to comment
Share on other sites

You would register a sound like you would for mon sounds and set its category to Ambient.

YouTube:

https://www.youtube.com/channel/UCaK5oRw4yd7PurBWww9tVhA

Kuribo64 (where I am most active):

http://kuribo64.net/board/profile.php?id=1423

 

Thanks for your answer!

 

Current projects:

 

3D Geometry Dash: 13%

Terracraft (MC Mod): 8%

New Super Kaizo Bros DS: 100% (no download for now :'( )

New Super Kaizo Bros. Wii: 12%

Super Mario Galaxy 1.5: 96%

New Super Mario Bros Galaxy: 85%

Kerbal Space Program Advance: 47%

MC CREATE: 20%

Mystery Projects: 10%, 40%, 13%, and 94%

Link to comment
Share on other sites

I would do that through a custom resource pack that has the sound file replaced with a "no sound file". Or you could cancel the music play event? I am not sure what it is called... D:

YouTube:

https://www.youtube.com/channel/UCaK5oRw4yd7PurBWww9tVhA

Kuribo64 (where I am most active):

http://kuribo64.net/board/profile.php?id=1423

 

Thanks for your answer!

 

Current projects:

 

3D Geometry Dash: 13%

Terracraft (MC Mod): 8%

New Super Kaizo Bros DS: 100% (no download for now :'( )

New Super Kaizo Bros. Wii: 12%

Super Mario Galaxy 1.5: 96%

New Super Mario Bros Galaxy: 85%

Kerbal Space Program Advance: 47%

MC CREATE: 20%

Mystery Projects: 10%, 40%, 13%, and 94%

Link to comment
Share on other sites

4 minutes ago, diesieben07 said:

PlaySoundEvent can be used to cancel any sound.

So there is a variable there that is equal to the sound being played?

If so, then the obvious approach would be to cancel the event if the sound is the one being removed. (˶‾᷄ ⁻̫ ‾᷅˵)

 

Another method could be to completely cancel all the sounds and make your own "sound player". But PLEASE don't do this if there is a better way. :P

YouTube:

https://www.youtube.com/channel/UCaK5oRw4yd7PurBWww9tVhA

Kuribo64 (where I am most active):

http://kuribo64.net/board/profile.php?id=1423

 

Thanks for your answer!

 

Current projects:

 

3D Geometry Dash: 13%

Terracraft (MC Mod): 8%

New Super Kaizo Bros DS: 100% (no download for now :'( )

New Super Kaizo Bros. Wii: 12%

Super Mario Galaxy 1.5: 96%

New Super Mario Bros Galaxy: 85%

Kerbal Space Program Advance: 47%

MC CREATE: 20%

Mystery Projects: 10%, 40%, 13%, and 94%

Link to comment
Share on other sites

1 minute ago, TheSunCat said:

So there is a variable there that is equal to the sound being played?

If so, then the obvious approach would be to cancel the event if the sound is the one being removed. (˶‾᷄ ⁻̫ ‾᷅˵)

Yes, of course.

 

1 minute ago, TheSunCat said:

Another method could be to completely cancel all the sounds and make your own "sound player". But PLEASE don't do this if there is a better way. :P

What... why...

Link to comment
Share on other sites

Just now, diesieben07 said:

What... why...

For the sake of giving multiple options..... Still, please don't use that, it is a bad bad bad way... D':

YouTube:

https://www.youtube.com/channel/UCaK5oRw4yd7PurBWww9tVhA

Kuribo64 (where I am most active):

http://kuribo64.net/board/profile.php?id=1423

 

Thanks for your answer!

 

Current projects:

 

3D Geometry Dash: 13%

Terracraft (MC Mod): 8%

New Super Kaizo Bros DS: 100% (no download for now :'( )

New Super Kaizo Bros. Wii: 12%

Super Mario Galaxy 1.5: 96%

New Super Mario Bros Galaxy: 85%

Kerbal Space Program Advance: 47%

MC CREATE: 20%

Mystery Projects: 10%, 40%, 13%, and 94%

Link to comment
Share on other sites

I suggest looking at the classes in the net.minecraft.client.audio package.

 

You can probably use SoundHandler#getAccessor to get the SoundEventAccessor of a vanilla SoundEvent and use SoundEventAccessor#addSound to add a sound to it.

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.

Link to comment
Share on other sites

14 hours ago, Choonster said:

I suggest looking at the classes in the net.minecraft.client.audio package.

 

You can probably use SoundHandler#getAccessor to get the SoundEventAccessor of a vanilla SoundEvent and use SoundEventAccessor#addSound to add a sound to it.

Thanks, you made me go in right way.
By looking at theese classes and using some reflection, I have made all that i wanted.

 

Edited by CeperaProduction
Link to comment
Share on other sites

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
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • I am attempting to create a Valhelsia 3 server and keep running into this error on startup 2022-01-28 16:29:43,899 main WARN Advanced terminal features are not available in this environment [16:29:43] [main/INFO] [cp.mo.mo.Launcher/MODLAUNCHER]: ModLauncher running: args [--gameDir, ., --launchTarget, fmlserver, --fml.forgeVersion, 36.2.22, --fml.mcpVersion, 20210115.111550, --fml.mcVersion, 1.16.5, --fml.forgeGroup, net.minecraftforge, nogui] [16:29:43] [main/INFO] [cp.mo.mo.Launcher/MODLAUNCHER]: ModLauncher 8.0.9+86+master.3cf110c starting: java version 1.8.0_322 by Temurin [16:29:44] [main/INFO] [ne.mi.fm.lo.FixSSL/CORE]: Added Lets Encrypt root certificates as additional trust [16:29:44] [main/INFO] [mixin/]: SpongePowered MIXIN Subsystem Version=0.8.4 Source=file:/C:/multimc/Valhesia%20server/libraries/org/spongepowered/mixin/0.8.4/mixin-0.8.4.jar Service=ModLauncher Env=SERVER [16:29:45] [main/INFO] [STDERR/]: [org.antlr.v4.runtime.ConsoleErrorListener:syntaxError:38]: line 1:0 token recognition error at: '~' Init CreativeCore coremods ... [16:29:46] [main/ERROR] [mixin/]: Mixin config notenoughcrashes.mixins.json does not specify "minVersion" property [16:29:46] [main/ERROR] [mixin/]: Mixin config notenoughcrashes.forge.mixins.json does not specify "minVersion" property Exception in thread "main" [16:29:46] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: java.lang.NoSuchMethodError: sun.security.util.ManifestEntryVerifier.<init>(Ljava/util/jar/Manifest;)V [16:29:46] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]:       at cpw.mods.modlauncher.SecureJarHandler.createCodeSource(SecureJarHandler.java:66) [16:29:46] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]:       at cpw.mods.modlauncher.TransformingClassLoader$DelegatedClassLoader.findClass(TransformingClassLoader.java:275) [16:29:46] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]:       at cpw.mods.modlauncher.TransformingClassLoader.loadClass(TransformingClassLoader.java:136) [16:29:46] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]:       at cpw.mods.modlauncher.TransformingClassLoader.loadClass(TransformingClassLoader.java:98) [16:29:46] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]:       at java.lang.ClassLoader.loadClass(ClassLoader.java:351) [16:29:46] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]:       at java.lang.Class.forName0(Native Method) [16:29:46] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]:       at java.lang.Class.forName(Class.java:348) [16:29:46] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]:       at org.spongepowered.asm.service.modlauncher.ModLauncherClassProvider.findClass(ModLauncherClassProvider.java:67) [16:29:46] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]:       at org.spongepowered.asm.launch.platform.MixinConnectorManager.loadConnectors(MixinConnectorManager.java:70) [16:29:46] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]:       at org.spongepowered.asm.launch.platform.MixinConnectorManager.inject(MixinConnectorManager.java:59) [16:29:46] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]:       at org.spongepowered.asm.launch.platform.MixinPlatformManager.inject(MixinPlatformManager.java:196) [16:29:46] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]:       at org.spongepowered.asm.launch.MixinBootstrap.inject(MixinBootstrap.java:202) [16:29:46] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]:       at org.spongepowered.asm.launch.MixinLaunchPluginLegacy.initializeLaunch(MixinLaunchPluginLegacy.java:201) [16:29:46] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]:       at org.spongepowered.asm.launch.MixinLaunchPluginLegacy.initializeLaunch(MixinLaunchPluginLegacy.java:195) [16:29:46] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]:       at cpw.mods.modlauncher.LaunchPluginHandler.lambda$announceLaunch$9(LaunchPluginHandler.java:97) [16:29:46] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]:       at java.util.HashMap.forEach(HashMap.java:1290) [16:29:46] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]:       at cpw.mods.modlauncher.LaunchPluginHandler.announceLaunch(LaunchPluginHandler.java:97) [16:29:46] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]:       at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:52) [16:29:46] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]:       at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [16:29:46] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]:       at cpw.mods.modlauncher.Launcher.run(Launcher.java:82) [16:29:46] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]:       at cpw.mods.modlauncher.Launcher.main(Launcher.java:66) [16:29:46] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]:       at net.minecraftforge.server.ServerMain$Runner.runLauncher(ServerMain.java:63) [16:29:46] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]:       at net.minecraftforge.server.ServerMain$Runner.access$100(ServerMain.java:60) [16:29:46] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]:       at net.minecraftforge.server.ServerMain.main(ServerMain.java:57) I have tried JDK 8 from oracle and adoptium with no luck.
    • 👀my issue sorry😅, then do it on client an send a custom package to the server https://forge.gemwire.uk/wiki/SimpleChannel
    • downgrade your java to java 8 320
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.