# EntityHealed

`com.jsmacrosce.jsmacros.client.api.event.impl.world.EventEntityHealed`

**Since:** 1.6.5

**Cancellable:** No. Calling `event.cancel()` throws `UnsupportedOperationException`.

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 {#com.jsmacrosce.jsmacros.client.api.event.impl.world.EventEntityHealed_constructor-Entity-float-float-}

```js
new EventEntityHealed(Entity e, float health, float amount)
```

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 [NullPointerException](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/NullPointerException.html)
- `health`: supplied new-health value, stored unchanged without applying it
- `amount`: supplied health-increase value, stored unchanged as `damage`; it is not validated or calculated

## Fields

### damage {#com.jsmacrosce.jsmacros.client.api.event.impl.world.EventEntityHealed_damage}

```js
damage: float
```

Positive difference between the supplied health and the previous health.

### entity {#com.jsmacrosce.jsmacros.client.api.event.impl.world.EventEntityHealed_entity}

```js
entity: EntityHelper<?>
```

Client-side living entity whose supplied health value increased.

### health {#com.jsmacrosce.jsmacros.client.api.event.impl.world.EventEntityHealed_health}

```js
health: float
```

Health value supplied to `setHealth`, before it is applied.

## Methods

### toString {#com.jsmacrosce.jsmacros.client.api.event.impl.world.EventEntityHealed_toString-}

```js
toString(): String
```

Formats the event name, entity string, and stored health values as a diagnostic string.

**Returns:** a string in the form `eventName:{"entity": entityString, "health": health, "damage": damage}`
