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'm trying to make a custom record in my mod, and when insert the record into the juke box, nothing happens, nor does it say that it's playing.
My mus_battle2 sound works fine with /playsound, does anyone know what I'm missing or doing wrong?

http://pastebin.com/XzmAAYsa (I've added my ItemModRecord, ModSoundEvent and ModItems classes)

  • Author
9 minutes ago, diesieben07 said:
  • Why did you extend ItemRecord and copy-paste it into your class? Only do the former.
  • What's your sounds.json?
  • ModSoundEvent::init / ModSoundEvent::register are never called.
  • Your main mod class is a giant mess. Lots of empty auto-generated methods that do nothing and the formatting is all over the place.
  • Your way of registering models is outdated and broken. Use ModelLoader.setCustomModelResourceLocation only.

1. because I tried without the parts I copied and that didn't work at all
 

        "mus_battle2": {
        "category": "master",
        "sounds": [
        {"name":"servermod:mus_battle2", "stream": true}
        ],
           
        "subtitle": "Enemy appears"
    }
}   

3. I thought my smg needed that? but ok
4. that's not my main mod class, but it's neat/"organised" enough for me to understand
5. I was only following what I was told in a 1.11.2 tutorial

Edited by SparkyFox95

  • Author
50 minutes ago, diesieben07 said:

So then why did you not try to just delete the class? Because that an equally (in-)adequate solution to "it didn't work".

 

What are you talking about?

 

Then that tutorial is wrong and you should drop it immediately and yell at it's author to stop being stupid.

  • the game works fine and runs on a server...
  • its doesn't matter, about the SMG's custom sound, its getting the custom record to play mus_battle2
  • ....no.... the guy has actually been the most helpful out of all other tutorials I've seen, plus, theres no need for yelling at someone that spends hours of their busy life setting up a tutorial for people

===


Is anyone able to help? I got a feeling it has something todo with this this line;
 

@Override
public ResourceLocation getRecordResource(String name){
return new ResourceLocation(ServerMod.MOD_ID, "RECORD_Battle2");}

I've tried ServerMod.Resource_Prefix...

Edited by SparkyFox95

You need to look into the jukebox's code, set a breakpoint or two and step through what happens when you pop your disc into it. In particular, you need to see whether the handling derails on the server or spawns a message to the client to be derailed there.

 

If the latter, then you need to hunt down the message handler and set another breakpoint or two and run again in the debugger. The vanilla handler might be making an assumption that simply does not support having discs beyond the vanilla ones (The situation with paintings is like that).  In such cases, custom handlers or even custom messages may be required.

Edited by jeffryfisher

The debugger is a powerful and necessary tool in any IDE, so learn how to use it. You'll be able to tell us more and get better help here if you investigate your runtime problems in the debugger before posting.

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.