public static interface Explosion.Builder extends ResettableBuilder<Explosion,Explosion.Builder>
Explosion
.Modifier and Type | Method and Description |
---|---|
Explosion |
build()
Attempts to create a
Explosion from the specified parameters. |
Explosion.Builder |
canCauseFire(boolean fire)
Sets whether the affected blocks have a chance to catch on fire.
|
default Explosion.Builder |
knockback(double knockback)
Sets the relative strength of the knockback applied to nearby
objects that can be knocked back.
|
Explosion.Builder |
location(Location<World> location)
Sets the location origin of the explosion.
|
Explosion.Builder |
radius(float radius)
Sets the radius of the explosion.
|
default Explosion.Builder |
randomness(float randomness)
Indicates the desired randomness of the form of the explosion.
|
default Explosion.Builder |
resolution(int resolution)
Sets the resolution of the explosion.
|
Explosion.Builder |
shouldBreakBlocks(boolean destroy)
Sets whether the affected blocks should be destroyed on explosion.
|
Explosion.Builder |
shouldDamageEntities(boolean damage)
Sets whether the explosion will damage entities nearby.
|
Explosion.Builder |
shouldPlaySmoke(boolean smoke)
Sets whether the explosion will have smoke particles.
|
Explosion.Builder |
sourceExplosive(Explosive source)
Sets the source explosive of the explosion.
|
from, reset
Explosion.Builder location(Location<World> location)
location
- Origin of explosionExplosion.Builder sourceExplosive(@Nullable Explosive source)
source
- The source entityExplosion.Builder radius(float radius)
radius
- The radiusExplosion.Builder canCauseFire(boolean fire)
fire
- Whether the affected blocks can catch on fireExplosion.Builder shouldDamageEntities(boolean damage)
damage
- Whether the explosion will damage entitiesExplosion.Builder shouldPlaySmoke(boolean smoke)
smoke
- Whether the explosion will have smoke particlesExplosion.Builder shouldBreakBlocks(boolean destroy)
destroy
- Whether the affected blocks should be destroyeddefault Explosion.Builder resolution(int resolution)
resolution
- The desired resolution of the explosiondefault Explosion.Builder randomness(float randomness)
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.
default Explosion.Builder knockback(double knockback)
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.
knockback
- The knockback multipleExplosion build() throws IllegalArgumentException
Explosion
from the specified parameters.IllegalArgumentException
- If any builder parameter is invalid