I was recently making a plugin for an RPG server. So, I displayed the health using setHealth(). But, I want to make the damage event only cancel damage that is changed using setHealth(). I tried Code (Java): !e.getCause().equals(DamageCause.CUSTOM) , but didn't work. Can somebody help?
You could potentially make a custom spigot jar and modify the setHealth() bit to call a custom event.