Jump to content

Event when Jukebox starts/stops


FunshineX

Recommended Posts

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

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.



×
×
  • Create New...

Important Information

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