Jump to content

Recommended Posts

Posted

So, here's what I wanna do: I have an item that's supposed to be used with another block that would damage it (if you want specifics, it's supposed to be for Pyrotech's chopping block). I want it so that once the item runs out of durability, it'd transform into another item rather than breaking outright. I can't seem to figure out how I'd do this, though. Here are the things I've tried:

  • Edit the setDamage function. Problem is, there's no method to change the stack's item or get the holder of the itemstack that I've seen, so it wouldn't work.
  • Use onItemUseFinish. It...doesn't seem to fire at all with this.
  • Subscribe to PlayerDestroyItemEvent. This feels too unspecific, and the event might fire when I don't want it to.

Is there some way of doing this properly?

Posted

Alright, after some testing, it seems that for whatever reason, the chopping block won't trigger PlayerDestroyItemEvent, either. Which is odd, because looking at Pyrotech's code, it seems to use stack.damageItem properly for this. Wonder what's going on...

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.

Announcements



×
×
  • Create New...

Important Information

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