Interface Explosion.Builder

All Superinterfaces:
AbstractBuilder<Explosion>, Builder<Explosion,Explosion.Builder>, CopyableBuilder<Explosion,Explosion.Builder>, ResettableBuilder<Explosion,Explosion.Builder>
Enclosing interface:
Explosion

public static interface Explosion.Builder extends Builder<Explosion,Explosion.Builder>, CopyableBuilder<Explosion,Explosion.Builder>
A builder for Explosion.
  • Method Details

    • location

      Explosion.Builder location(ServerLocation location)
      Sets the location origin of the explosion.
      Parameters:
      location - Origin of explosion
      Returns:
      The builder, for chaining
    • sourceExplosive

      Explosion.Builder sourceExplosive(@Nullable Explosive source)
      Sets the source explosive of the explosion.
      Parameters:
      source - The source entity
      Returns:
      The builder, for chaining
    • radius

      Explosion.Builder radius(float radius)
      Sets the radius of the explosion.
      Parameters:
      radius - The radius
      Returns:
      The builder, for chaining
    • canCauseFire

      Explosion.Builder canCauseFire(boolean fire)
      Sets whether the affected blocks have a chance to catch on fire.
      Parameters:
      fire - Whether the affected blocks can catch on fire
      Returns:
      The builder, for chaining
    • shouldDamageEntities

      Explosion.Builder shouldDamageEntities(boolean damage)
      Sets whether the explosion will damage entities nearby.
      Parameters:
      damage - Whether the explosion will damage entities
      Returns:
      This builder, for chaining
    • shouldPlaySmoke

      Explosion.Builder shouldPlaySmoke(boolean smoke)
      Sets whether the explosion will have smoke particles.
      Parameters:
      smoke - Whether the explosion will have smoke particles
      Returns:
      This builder, for chaining
    • shouldBreakBlocks

      Explosion.Builder shouldBreakBlocks(boolean destroy)
      Sets whether the affected blocks should be destroyed on explosion.
      Parameters:
      destroy - Whether the affected blocks should be destroyed
      Returns:
      The builder, for chaining
    • resolution

      default Explosion.Builder resolution(int resolution)
      Sets the resolution of the explosion.
      Parameters:
      resolution - The desired resolution of the explosion
      Returns:
      The builder, for chaining
    • randomness

      default Explosion.Builder randomness(float randomness)
      Indicates the desired randomness of the form of the explosion.

      This value indicates how close to being symmetrical the explosion is. A value of zero indicates a completely symmetrical blast (in all three dimensions). A larger value indicates a lower likelihood of symmetry. A value of one indicates the platform default.

      Note, this is a hint to the implementation. Implementations may not provide the means to produce semi-random form explosions.

      Parameters:
      randomness - The randomness
      Returns:
      This builder, for chaining
    • knockback

      default Explosion.Builder knockback(double knockback)
      Sets the relative strength of the knockback applied to nearby objects that can be knocked back.

      Note that the default behavior and strength is not defined here. A return value of 1 simply indicates the default behavior which is implementation dependent.

      Parameters:
      knockback - The knockback multiple
      Returns:
      This builder, for chaining
    • build

      Attempts to create a Explosion from the specified parameters.
      Specified by:
      build in interface AbstractBuilder<Explosion>
      Returns:
      The explosion, if successful
      Throws:
      IllegalArgumentException - If any builder parameter is invalid