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 theBlockSnapshot
to act as the "damage source".block
(@Nullable ServerLocation location) Sets theServerLocation
to use as a "source".build()
Builds an instance of this damage source, based on the values you inputted into the builder.Sets theEntity
as the damage "source".indirectEntity
(@Nullable Entity proxy) Sets theEntity
that is indirectly damaging.default DamageSource.Builder
type
(Supplier<? extends DamageType> damageType) Sets theDamageType
of this source.type
(DamageType damageType) Sets theDamageType
of this source.Methods inherited from interface org.spongepowered.api.util.CopyableBuilder
from
-
Method Details
-
type
Sets theDamageType
of this source.This is required to be set.
- Parameters:
damageType
- The desired damage type- Returns:
- This builder
-
type
Sets theDamageType
of this source.This is required to be set.
- Parameters:
damageType
- The desired damage type- Returns:
- This builder
-
entity
Sets theEntity
as the damage "source".- Parameters:
entity
- The entity- Returns:
- This builder, for chaining
-
indirectEntity
Sets theEntity
that is indirectly damaging.- Parameters:
proxy
- The indirect entity- Returns:
- This builder, for chaining
-
block
Sets theServerLocation
to use as a "source".- Parameters:
location
- The location of the block as the damage source- Returns:
- This builder, for chaining
-
block
Sets theBlockSnapshot
to 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:
build
in interfaceAbstractBuilder<DamageSource>
- Returns:
- The resulting damage source
- Throws:
IllegalStateException
- If a value required to be set is not set
-