Help with Making a Single-Use Item

Started by Connorchap on

Topic category: Help with modding (Java Edition)

Last seen on 19:16, 11. Jun 2017
Joined Jun 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Help with Making a Single-Use Item

Haldo! Just starting out making some test items with potion effects/sounds/achievements, simple stuff. Everything's been going great, until I tried making the items single-use. Then things got confusing.

I thought giving the item durability:1 and adding a Damage Item event of 1 to the right-click would do it, but every time I add the Damage Item event it just throws an exception.

So then I started looking into the difference between Max Item Usage Duration and Item Damage Count, and ... I honestly can't find any documentation that describes what that first one does. Seriously, the wiki has the same description word-for-word across those two entries. I tried giving the item 1 of either or both, but it always had infinite uses in-game. No other forum poster seems to have had this specific question/problem that I can find, hence this new topic.

TL;DR: How do I make a single-use item that gets destroyed when you right-click with it, and what does Max Item Usage Duration mean? And why does the Damage Item event break the mod? Thanks!

Last seen on 19:16, 11. Jun 2017
Joined Jun 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Also, the item is supposed to
Thu, 06/08/2017 - 01:14

Also, the item is supposed to be stackable, which is probably what screws up the durability; now I feel dumb! But the question regarding "Max Item Usage Duration" remains, as does the overall point of making a single-use, stackable item, similar to how bone meal or eyes of ender get used up upon right-clicking

Last seen on 22:52, 27. Oct 2017
Joined Nov 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I would just do the affects
Thu, 06/08/2017 - 08:56

I would just do the affects and remove 1 of the times, so it can stay stackable you can remove its vai events :)

Last seen on 19:16, 11. Jun 2017
Joined Jun 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
RE:I would just do the affects
Thu, 06/08/2017 - 16:41

@#2 Nice, thanks for the suggestion! That kinda works, though it removes one of the item based on inventory position: so if I'm holding a stack of items in my hand, but there's also a stack in the inventory, it takes one from the inventory instead of my hand. But it's close enough, so again, thanks! :)