Skip to content

Heal ​

com.jsmacrosce.jsmacros.client.api.event.impl.player.EventHeal

Since1.6.5Not cancellable

Fires before the local player's health is updated to a higher value. It reports the observed change rather than its cause; source is always the generic damage type.

js
JsMacros.on("Heal", JavaWrapper.methodToJava(function (event) {
 Chat.log(`Healed ${event.change} hp, now at ${event.health} hp`);  
}))

Constructors ​

new EventHeal ​

new EventHeal(DamageSource source, float health, float change)#
Initializes the event with the message id from the supplied damage source and the supplied health values; it does not update health or dispatch the event.

Parameters:

  • source: damage source whose message id is captured; null causes NullPointerException.
  • health: supplied health value
  • change: supplied health-increase amount

Fields ​

change ​

change: floatread-only#
Positive difference between the previous health value and the value being written, in health points.

health ​

health: floatread-only#
Health value being written, in health points (two points per heart).

source ​

source: Stringread-only#
Message id of the generic damage type; the cause of the health increase is not reported.

Methods ​

toString ​

toString(): String#
Returns a diagnostic string containing the event name, stored health, and stored change. The source is omitted; the result is not a JSON serialization.
Returns: diagnostic text in the form %s:{"health": %f, "change": %f}