Class EntityVelocityEvent

java.lang.Object
net.minestom.server.event.entity.EntityVelocityEvent
All Implemented Interfaces:
Event, CancellableEvent, EntityEvent, EntityInstanceEvent, InstanceEvent

public class EntityVelocityEvent extends Object implements EntityInstanceEvent, CancellableEvent
Called when a velocity is applied to an entity using Entity.setVelocity(Vec).
  • Constructor Details

    • EntityVelocityEvent

      public EntityVelocityEvent(@NotNull @NotNull Entity entity, @NotNull @NotNull Vec velocity)
  • Method Details

    • getEntity

      @NotNull public @NotNull Entity getEntity()
      Gets the enity who will be affected by getVelocity().
      Specified by:
      getEntity in interface EntityEvent
      Returns:
      the entity
    • getVelocity

      @NotNull public @NotNull Vec getVelocity()
      Gets the velocity which will be applied.
      Returns:
      the velocity
    • setVelocity

      public void setVelocity(@NotNull @NotNull Vec velocity)
      Changes the applied velocity.
      Parameters:
      velocity - the new velocity
    • isCancelled

      public boolean isCancelled()
      Description copied from interface: CancellableEvent
      Gets if the Event should be cancelled or not.
      Specified by:
      isCancelled in interface CancellableEvent
      Returns:
      true if the event should be cancelled
    • setCancelled

      public void setCancelled(boolean cancel)
      Description copied from interface: CancellableEvent
      Marks the Event as cancelled or not.
      Specified by:
      setCancelled in interface CancellableEvent
      Parameters:
      cancel - true if the event should be cancelled, false otherwise