Jeryn99 / Regeneration

Minecraft Mod - Adds the concept of Regeneration from the show Doctor who
https://minecraft.curseforge.com/projects/regeneration
GNU Lesser General Public License v3.0
31 stars 19 forks source link

Problem with CraftTweaker #400

Closed Kasualix closed 1 year ago

Kasualix commented 1 year ago

I don't want the players to be hurt when they are regenerating so I wrote the script. And the error just occurred when I was attacked.

For the CrT's end: https://github.com/CraftTweaker/CraftTweaker/issues/1590

Minecraft 1.16.5 Forge 36.2.39 Regeneration 36.0.2

Kasualix commented 1 year ago

I've solved it myself.

Jeryn99 commented 1 year ago

Ah what was it?

Kasualix commented 1 year ago

Instead of "event.cancel();", I used "event.setAmount(0.0);" so the event process of Regeneration won't be affected.

Kasualix commented 1 year ago

hmmmm, my bad. I didn't check it out before closing this issue Same errors still occurred after that......

Kasualix commented 1 year ago

I found the real problem finally... I'm updating player data in tick event and that's the very thing affecting the Regeneration process. Now I move the updateData into another event and it works fine. Sorry.