Interface DamageSource.Builder
- All Superinterfaces:
AbstractBuilder<DamageSource>,Builder<DamageSource,,DamageSource.Builder> CopyableBuilder<DamageSource,,DamageSource.Builder> ResettableBuilder<DamageSource,DamageSource.Builder>
- Enclosing interface:
DamageSource
public static interface DamageSource.Builder
extends Builder<DamageSource,DamageSource.Builder>, CopyableBuilder<DamageSource,DamageSource.Builder>
-
Method Summary
Modifier and TypeMethodDescriptionblock(@Nullable BlockSnapshot blockSnapshot) Sets theBlockSnapshotto act as the "damage source".block(@Nullable ServerLocation location) Sets theServerLocationto use as a "source".build()Builds an instance of this damage source, based on the values you inputted into the builder.Sets theEntityas the damage "source".indirectEntity(@Nullable Entity proxy) Sets theEntitythat is indirectly damaging.default DamageSource.Buildertype(Supplier<? extends DamageType> damageType) Sets theDamageTypeof this source.type(DamageType damageType) Sets theDamageTypeof this source.Methods inherited from interface org.spongepowered.api.util.CopyableBuilder
from
-
Method Details
-
type
Sets theDamageTypeof this source.This is required to be set.
- Parameters:
damageType- The desired damage type- Returns:
- This builder
-
type
Sets theDamageTypeof this source.This is required to be set.
- Parameters:
damageType- The desired damage type- Returns:
- This builder
-
entity
Sets theEntityas the damage "source".- Parameters:
entity- The entity- Returns:
- This builder, for chaining
-
indirectEntity
Sets theEntitythat is indirectly damaging.- Parameters:
proxy- The indirect entity- Returns:
- This builder, for chaining
-
block
Sets theServerLocationto use as a "source".- Parameters:
location- The location of the block as the damage source- Returns:
- This builder, for chaining
-
block
Sets theBlockSnapshotto act as the "damage source".- Parameters:
blockSnapshot- The block snapshot to use as the damage source- Returns:
- This builder, for chaining
-
build
Builds an instance of this damage source, based on the values you inputted into the builder.- Specified by:
buildin interfaceAbstractBuilder<DamageSource>- Returns:
- The resulting damage source
- Throws:
IllegalStateException- If a value required to be set is not set
-