Started by
rozaly
on
Topic category: Help with Minecraft modding (Java Edition)
Does anyone have any idea how I would go about adding chip damage?
It would be damage that can't heal from saturation, only regeneration or health effects. It can't kill you, but if you are hurt all your chip damage turns into normal damage.
It would be very similar to internal damage from the game Nine Sols (that's what I'm basing it off of, at least. Look it up if you need to)
Not healing from saturation would be too much work for the effort to implement it. You would need to check and save hunger and then test whether hunger changes, when it does also test for health changes then check whether regen or health effects are active. If not you then set the player health back to the original value prior to the healing from saturation.
For internal damage. You can use a integer variable, it adds up each time the player takes a certain damage type/source which would be your custom chip damage. Then on whatever condition you like, you use that integer and apply it to the player as damage and reset the integer to 0.