# WorldClass.server_onMelee

Called when a melee attack hits something in this world.

**Kind:** Callback

**Environments:** Game

## Game

**Callback side:** Server

``` { .lua .api-signature }
WorldClass:server_onMelee(
    position,
    attacker,
    target,
    damage,
    power,
    direction,
    normal
)
```

[Open the full Game reference](../Game-Script-Environment/Classes/WorldClass.md#server_onmelee)

> **Note:**
> If the attacker is destroyed before the hit lands, the attacker value will be nil.

**Parameters:**

| Name | Type | Description |
| --- | --- | --- |
| `self` | table | The class instance. |
| `position` | [Vec3](../Game-Script-Environment/Userdata/Vec3.md) | The position in world space where the attack hit. |
| `attacker` | [Player](../Game-Script-Environment/Userdata/Player.md)/[Unit](../Game-Script-Environment/Userdata/Unit.md)/nil | The attacker. Can be a [Player](../Game-Script-Environment/Userdata/Player.md), [Unit](../Game-Script-Environment/Userdata/Unit.md) or nil if unknown. |
| `target` | [Character](../Game-Script-Environment/Userdata/Character.md)/[Shape](../Game-Script-Environment/Userdata/Shape.md)/[Harvestable](../Game-Script-Environment/Userdata/Harvestable.md)/[Lift](../Game-Script-Environment/Userdata/Lift.md)/nil | The hit target. Can be a [Character](../Game-Script-Environment/Userdata/Character.md), [Shape](../Game-Script-Environment/Userdata/Shape.md), [Harvestable](../Game-Script-Environment/Userdata/Harvestable.md), [Lift](../Game-Script-Environment/Userdata/Lift.md) or nil if terrain or unknown. |
| `damage` | integer | The damage value of the melee hit. |
| `power` | number | The physical impact impact of the hit. |
| `direction` | [Vec3](../Game-Script-Environment/Userdata/Vec3.md) | The direction that the melee attack was made. |
| `normal` | [Vec3](../Game-Script-Environment/Userdata/Vec3.md) | The normal at the point of impact. |
