# hbm:entity_enchantment_level

Reads an enchantment level from a loot-context entity.

**since NTM 1.0.2**

Returns the specified enchantment's level on a living entity selected from the loot context. Returns 0 when that entity is absent or is not living. It can supply a pool's `rolls` or any other loot-table field accepting a vanilla number provider.

## Fields

| Field | Meaning and default |
| - | - |
| `type` | `hbm:entity_enchantment_level`. |
| `entity` | Loot-context entity selector: `this`, `attacker`, `direct_attacker` or `attacking_player`. |
| `enchantment` | Registered enchantment ID. |

## Example:

A number provider reading the attacker's Looting level:

```json
{
  "type": "hbm:entity_enchantment_level",
  "entity": "attacker",
  "enchantment": "minecraft:looting"
}
```
