Modify the state of an object?

Started by nl_nl_n on

Topic category: Help with modding (Java Edition)

Last seen on 04:42, 9. Sep 2024
Joined Oct 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Modify the state of an object?

(Google translator)

Hello, I need to know if you can do the following example (3a, 3b):

1_    I have a sword (both my mod and vanilla) and a sharpening stone.
2_    I use the sword for a while and it takes some damage.
3a_    I combine with a craft the damaged sword and the sharpening stone. The resulting sword would be a new sword of the mod, called sharp sword, but it has to be created with the damage that had the sword with which I fabricated it.
3b_    I combine the objects with the sword and the sharpening stone in my hands with a right click, then the sword takes some kind of variable to use as a condition when hitting a mob and giving extra damage.

Taking the example as a context I can also ask directly, how can I create a variable to the item to call and modify my wish from any event?

 

Thanks in advance.

Last seen on 03:51, 31. Jul 2023
Joined Apr 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You can have a procedure…
Wed, 06/05/2019 - 03:22

You can have a procedure that checks whether the sword is damage or not "Check once if durability = "max durability"

Then make it turn into a sharp sword if so.