| Name | entity knocks back entity |
| Event Lines | <entity> knocks back <entity> |
| Triggers | when an entity is knocked back from the hit of another entity. |
| Generated Examples | after fish knocks back entity:
after animal knocks back vehicle: |
| Has Player | when the damager or damaged entity is a player. Cannot be both. - this adds switches 'flagged:<flag name>' + 'permission:<node>', in addition to the '<player>' link. |
| Has NPC | when the damager or damaged entity is an NPC. Cannot be both. |
| Switches | with:<item> to only process the event when the item used to cause damage (in the damager's hand) is a specified item. |
| Contexts | <context.entity> returns the EntityTag that was knocked back.
<context.damager> returns the EntityTag of the one who knocked.
<context.acceleration> returns the knockback applied as a vector.
<context.cause> returns the cause of the knockback (only on MC 1.20+). Causes list: https://jd.papermc.io/paper/1.21.1/io/papermc/paper/event/entity/EntityKnockbackEvent.Cause.html
|
| Determine | LocationTag as a vector to change the acceleration applied. |
| Cancellable | True - This adds <context.cancelled> and determine 'cancelled' or 'cancelled:false' |
| Has Location | True - This adds the switches 'in:<area>', 'location_flagged:<flag>', ... |
| Group | Paper |
| Requires | Paper |
| Warning(s) | this event may in some cases double-fire, requiring usage of the 'ratelimit' command (like 'ratelimit <player> 1t') to prevent doubling actions. |
| Source | https://github.com/DenizenScript/Denizen/blob/dev/paper/src/main/java/com/denizenscript/denizen/paper/events/EntityKnocksbackEntityScriptEvent.java#L17 |