Commits
coll1234567 authored and md_5 committed cde4c52a8c1
1 + | package org.bukkit.event.entity; |
2 + | |
3 + | import org.bukkit.entity.Entity; |
4 + | import org.bukkit.entity.LivingEntity; |
5 + | import org.bukkit.util.Vector; |
6 + | import org.jetbrains.annotations.NotNull; |
7 + | |
8 + | /** |
9 + | * Called when an entity receives knockback from another entity. |
10 + | */ |
11 + | public class EntityKnockbackByEntityEvent extends EntityKnockbackEvent { |
12 + | |
13 + | private final Entity source; |
14 + | |
15 + | public EntityKnockbackByEntityEvent( final LivingEntity entity, final Entity source, final KnockbackCause cause, final double force, final Vector rawKnockback, final Vector knockback) { |
16 + | super(entity, cause, force, rawKnockback, knockback); |
17 + | |
18 + | this.source = source; |
19 + | } |
20 + | |
21 + | /** |
22 + | * Get the entity that has caused knockback to the defender. |
23 + | * |
24 + | * @return entity that caused knockback |
25 + | */ |
26 + | |
27 + | public Entity getSourceEntity() { |
28 + | return source; |
29 + | } |
30 + | } |