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'd like to add an event that gets called when a jukebox starts playing a record or completes.  How would I do this? Do I need to write my own custom jukebox that extends the vanilla one?

  • Author

I'd like to also support if a mod put a record there, not just a player.  Going to look at TickHandlers and if that doesn't work I'll try a custom jukebox to replace the vanilla one

  • Author

I've got to the point where I extended the existing jukebox in my own custom jukebox and that all works great.

 

i.e.:

public class BlockGreenJukebox extends BlockJukeBox { 
... /snip

 

But the problem is that the sound as well as the insertRecord event  is triggered by the record item. 

 

public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
    {
        if (par3World.getBlockId(par4, par5, par6) == Block.jukebox.blockID && par3World.getBlockMetadata(par4, par5, par6) == 0)

 

I'd like to not have to write a custom record - just work with vanilla ones, but I'm not sure how to do that without overriding base classes.  The record item checks to verify the block at x,y,z is a jukebox, so it returns false if it finds my custom jukebox.

 

Any tips on how to make this work or should I just customize the records as well?

 

Thanks,

Ron

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.