Class EntityShootEvent

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

public class EntityShootEvent extends Object implements EntityInstanceEvent, CancellableEvent
  • Constructor Details

    • EntityShootEvent

      public EntityShootEvent(@NotNull @NotNull Entity entity, @NotNull @NotNull Entity projectile, @NotNull @NotNull Point to, double power, double spread)
  • Method Details

    • getProjectile

      public Entity getProjectile()
      Gets the projectile.
      Returns:
      the projectile.
    • getTo

      public Point getTo()
      Gets the position projectile was shot to.
      Returns:
      the position projectile was shot to.
    • getSpread

      public double getSpread()
      Gets shot spread.
      Returns:
      shot spread.
    • setSpread

      public void setSpread(double spread)
      Sets shot spread.
      Parameters:
      spread - shot spread.
    • getPower

      public double getPower()
      Gets shot power.
      Returns:
      shot power.
    • setPower

      public void setPower(double power)
      Sets shot power.
      Parameters:
      power - shot power.
    • 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
    • getEntity

      @NotNull public @NotNull Entity getEntity()
      Description copied from interface: EntityEvent
      Gets the entity of this event.
      Specified by:
      getEntity in interface EntityEvent
      Returns:
      the entity