EntityHealed
com.jsmacrosce.jsmacros.client.api.event.impl.world.EventEntityHealed
Fires before a client-side living entity's setHealth call when the supplied health is greater than its previous value. health is the supplied value and damage is the positive increase; this event does not identify the healing source.
js
JsMacros.on("EntityHealed", JavaWrapper.methodToJava(function (event) {
if (event.entity instanceof EntityHelpers.Villager) {
Chat.log(`Villager regained ${event.damage} health, ${event.health} hp now`);
}
}))Constructors
new EventEntityHealed
Wraps the supplied entity and stores the supplied health values; it does not apply a health change.
Parameters:
e: non-null entity to wrap; a null value causes NullPointerExceptionhealth: supplied new-health value, stored unchanged without applying itamount: supplied health-increase value, stored unchanged asdamage; it is not validated or calculated
Fields
damage
Positive difference between the supplied health and the previous health.
entity
Client-side living entity whose supplied health value increased.
health
Health value supplied to
setHealth, before it is applied.