> For the complete documentation index, see [llms.txt](https://docs.easy.gg/scripting/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.easy.gg/scripting/bedwars-scripting/objects/knockback.md).

# Knockback

### Parameters

#### fromPosition: [Vector3](https://create.roblox.com/docs/reference/engine/datatypes/Vector3)

The position from which knockback should be applied. If this is equal to the position of the hit entity, no knockback will be applied.

#### horizontal: number | nil

The amount of horizontal knockback applied. Defaults to 1. A value of 0 will apply no horizontal knockback.

#### vertical: number | nil

The amount of vertical knockback applied. Defaults to 1. A value of 0 will apply no vertical knockback.

Example usage:

```lua
-- All damage events launch the hit entity into the air with no damage
Events.EntityDamage(function(event)
    event.damage = 0
    event.knockback.horizontal = 0.5
    event.knockback.vertical = 5
    event.knockback.fromPosition = event.entity:getPosition() - Vector3.new(0,3,0)
end)
```

<pre class="language-lua"><code class="lang-lua"><strong>-- Cancels knockback for all damage events
</strong><strong>Events.EntityDamage(function(event)
</strong>    event.knockback.horizontal = 0
    event.knockback.vertical = 0
end)
</code></pre>
