Package org.bukkit.event.entity
Class EntityKnockbackEvent
java.lang.Object
org.bukkit.event.Event
org.bukkit.event.entity.EntityEvent
org.bukkit.event.entity.EntityKnockbackEvent
- All Implemented Interfaces:
Cancellable
- Direct Known Subclasses:
EntityKnockbackByEntityEvent
@Deprecated(forRemoval=true)
public class EntityKnockbackEvent
extends EntityEvent
implements Cancellable
Deprecated, for removal: This API element is subject to removal in a future version.
Called when a living entity receives knockback.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Deprecated, for removal: This API element is subject to removal in a future version.An enum to specify the cause of the knockback.Nested classes/interfaces inherited from class org.bukkit.event.Event
Event.Result
-
Field Summary
Fields inherited from class org.bukkit.event.entity.EntityEvent
entity
-
Constructor Summary
ConstructorDescriptionEntityKnockbackEvent
(@NotNull LivingEntity entity, @NotNull EntityKnockbackEvent.KnockbackCause cause, double force, @NotNull Vector rawKnockback, @NotNull Vector knockback) Deprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptiongetCause()
Deprecated, for removal: This API element is subject to removal in a future version.Gets the cause of the knockback.Deprecated, for removal: This API element is subject to removal in a future version.Returns the Entity involved in this eventDeprecated, for removal: This API element is subject to removal in a future version.Gets the force that will be applied to the entity.double
getForce()
Deprecated, for removal: This API element is subject to removal in a future version.Gets the raw force of the knockback.static @NotNull HandlerList
Deprecated, for removal: This API element is subject to removal in a future version.Deprecated, for removal: This API element is subject to removal in a future version.Deprecated, for removal: This API element is subject to removal in a future version.Gets the raw knockback force that will be applied to the entity.boolean
Deprecated, for removal: This API element is subject to removal in a future version.Gets the cancellation state of this event.void
setCancelled
(boolean cancel) Deprecated, for removal: This API element is subject to removal in a future version.Sets the cancellation state of this event.void
setFinalKnockback
(@NotNull Vector knockback) Deprecated, for removal: This API element is subject to removal in a future version.Sets the force that will be applied to the entity.Methods inherited from class org.bukkit.event.entity.EntityEvent
getEntityType
Methods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
EntityKnockbackEvent
public EntityKnockbackEvent(@NotNull @NotNull LivingEntity entity, @NotNull @NotNull EntityKnockbackEvent.KnockbackCause cause, double force, @NotNull @NotNull Vector rawKnockback, @NotNull @NotNull Vector knockback) Deprecated, for removal: This API element is subject to removal in a future version.
-
-
Method Details
-
getEntity
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:EntityEvent
Returns the Entity involved in this event- Overrides:
getEntity
in classEntityEvent
- Returns:
- Entity who is involved in this event
-
getCause
Deprecated, for removal: This API element is subject to removal in a future version.Gets the cause of the knockback.- Returns:
- the cause of the knockback
-
getForce
public double getForce()Deprecated, for removal: This API element is subject to removal in a future version.Gets the raw force of the knockback.
This value is based on factors such as theEnchantment.KNOCKBACK
level of an attacker and theAttribute.GENERIC_KNOCKBACK_RESISTANCE
of the entity.- Returns:
- the knockback force
-
getKnockback
Deprecated, for removal: This API element is subject to removal in a future version.Gets the raw knockback force that will be applied to the entity.
This value is read-only, changes made to it will not have any effect on the final knockback received.- Returns:
- the raw knockback
- See Also:
-
getFinalKnockback
Deprecated, for removal: This API element is subject to removal in a future version.Gets the force that will be applied to the entity.
In contrast togetKnockback()
this value is affected by the entities current velocity and whether they are touching the ground.Note: this method returns a copy, changes must be applied with
setFinalKnockback(Vector)
.- Returns:
- the final knockback
-
setFinalKnockback
Deprecated, for removal: This API element is subject to removal in a future version.Sets the force that will be applied to the entity.- Parameters:
knockback
- the force to apply
-
isCancelled
public boolean isCancelled()Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:Cancellable
Gets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins- Specified by:
isCancelled
in interfaceCancellable
- Returns:
- true if this event is cancelled
-
setCancelled
public void setCancelled(boolean cancel) Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:Cancellable
Sets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins.- Specified by:
setCancelled
in interfaceCancellable
- Parameters:
cancel
- true if you wish to cancel this event
-
getHandlers
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
getHandlers
in classEvent
-
getHandlerList
Deprecated, for removal: This API element is subject to removal in a future version.
-
EntityKnockbackEvent