Hey, i havent made mods in minecraft before and im currently starting out with trying to make some small simple mods.
Im currently trying to make a mod that checks when youre below a certain hp value and then gives you slowness or another potion effect.
I tried searching on google how to get the value from the player health as a int/var to use in a if sentence.
If anyone knows how to do this please respond!
I recommend you to follow this github MinecraftByExample to learn/start
To get the player's HP points, look at the source code of "PlayerEntity.class 🔗" it extends from "LivingEnity.class 🔗",
this class (LivingEntity.class) has getter and setter for HP.
Setter: player.setHealth(float f)🔗
The "PlayerEntity.class" class are in the "net.minecraft.entity.player 🔗" package
and "LivingEnity.class" in "net.minecraft.entity 🔗"
Good luck and have fun 🍻
Since a short period of time we now also have a patreon, consider dropping us a dollar or so if you enjoy this mod. 💝💝💝
You can find our patreon here.