# 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>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.easy.gg/scripting/bedwars-scripting/objects/knockback.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
