How can I add a returnable item when an item is broken?

Started by CookUpAStorm on

Topic category: Help with modding (Java Edition)

Last seen on 09:48, 24. Jul 2022
Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How can I add a returnable item when an item is broken?

I am so close to finishing my painted blocks mod, but there is one hurdle in my way. Is there any possible way to add a returnable item to the players inventory once a certain item is broken. For example I have made a paint tool in which when the paint runs out I want the bucket to be reusable. I haven't really found a suitable procedure for this. I tested the 2020.4 snapshot and tried the 'when item destroyed' trigger, but that doesn't work for me as it's global. So please if anyone knows a method (e.g. ideally a procedure, or custom code) please let me know. Thanks :)

Last seen on 09:48, 24. Jul 2022
Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I figured it out now, no…
Wed, 07/29/2020 - 09:04

I figured it out now, no need for answer

Last seen on 13:29, 27. Oct 2023
Joined Jun 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Hey! Can I just ask how to…
Sun, 11/22/2020 - 10:39

Hey! Can I just ask how to do this? I have searched other posts and I haven't found anything. I'm working on a sword that has an emerald in it, which makes it slightly better, but once its broken the diamond sword drops.