How to modify "MaxDamage" value for tools and armor?

Started by GamerDragon525 on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jul 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to modify "MaxDamage" value for tools and armor?
Wed, 10/04/2023 - 02:50 (edited)

Hello, as the title says I need help setting/modifying the "MaxDamage" property of tools and armor!

I have already done a decent amount of looking around and have accepted the fact I will have to do some coding and just need some help figuring out what I've been doing wrong, and why I keep getting errors whenever I try to build the project.

 

Here's the code I have so far as well as the error message I keep getting:

( https://pastebin.com/eUEbK1RY ) It was a lot of text so I decided to make a PasteBin for it! 

 

I'm using MCreator version 2023.2 with the 1.18.2 generator plugin by _Spectrall, and I have the custom code inside a procedure that I plan on setting to be triggered on "when item in inventory tick" for all my custom tools, weapons, and armor.

Any help would be greatly appreciated!! :D

Edited by GamerDragon525 on Wed, 10/04/2023 - 02:50
Joined Sep 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
MCreator can't find…
Sun, 11/12/2023 - 22:53

MCreator can't find setMaxDamage(int)

Joined Sep 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
probably the method you put…
Sun, 11/12/2023 - 22:54

probably the method you put doesn't exist, try looking at the itemstack class of 1.18.2