Interface Fireball

All Superinterfaces:
Audience, CommandSender, Entity, Explosive, HoverEventSource<HoverEvent.ShowEntity>, Metadatable, Nameable, Permissible, PersistentDataHolder, Pointered, Projectile, ServerOperator, Sound.Emitter
All Known Subinterfaces:
AbstractWindCharge, BreezeWindCharge, DragonFireball, LargeFireball, SizedFireball, SmallFireball, WindCharge, WitherSkull

public interface Fireball extends Projectile, Explosive
Represents a Fireball.
  • Method Details

    • setDirection

      void setDirection(@NotNull @NotNull Vector direction)
      Sets the direction the fireball should be flying towards.
      This is a convenience method, it will change the velocity direction and acceleration direction, while keeping the power the same.
      Note: This method only uses the direction of the vector and will normalize (a copy of) it.
      Special Case: When the given direction is zero, the velocity and acceleration will also be set to zero without keeping the power.
      Parameters:
      direction - the direction this fireball should be flying towards
      See Also:
    • getDirection

      @NotNull @Deprecated(since="1.20.6") @NotNull Vector getDirection()
      Deprecated.
      badly named method, returns the value of getAcceleration()
      Retrieve the direction this fireball is heading toward. The returned vector is not normalized.
      Returns:
      the direction
      See Also:
    • setAcceleration

      void setAcceleration(@NotNull @NotNull Vector acceleration)
      Sets the acceleration of the fireball. The acceleration gets applied to the velocity every tick, depending on the specific type of the fireball a damping / drag factor is applied so that the velocity does not grow into infinity.
      Note: that the client may not respect non-default acceleration power and will therefore mispredict the location of the fireball, causing visual stutter.
      Parameters:
      acceleration - the acceleration
    • getAcceleration

      @NotNull @NotNull Vector getAcceleration()
      Retrieve the acceleration of this fireball.
      Returns:
      the acceleration
    • setPower

      @Deprecated void setPower(@NotNull @NotNull Vector power)
      Deprecated.
      use #setAcceleration(Vector) instead.
      Sets the power of a fireball. The power determines the direction and magnitude of its acceleration.
      Parameters:
      power - the power
    • getPower

      Deprecated.
      Use #getAcceleration instead.
      Gets the power of a fireball. The power determines the direction and magnitude of its acceleration.
      Returns:
      the power