Package org.bukkit.damage
Interface DamageSource.Builder
- Enclosing interface:
- DamageSource
public static interface DamageSource.Builder
Utility class to make building a
DamageSource
easier. Only a
DamageType
is required.-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Create a newDamageSource
instance using the supplied parameters.withCausingEntity
(Entity entity) Set theEntity
that caused the damage.withDamageLocation
(Location location) Set theLocation
of the source of damage.withDirectEntity
(Entity entity) Set theEntity
that directly inflicted the damage.
-
Method Details
-
withCausingEntity
Set theEntity
that caused the damage.- Parameters:
entity
- the entity- Returns:
- this instance. Allows for chained method calls
- See Also:
-
withDirectEntity
Set theEntity
that directly inflicted the damage.- Parameters:
entity
- the entity- Returns:
- this instance. Allows for chained method calls
- See Also:
-
withDamageLocation
Set theLocation
of the source of damage.- Parameters:
location
- the location where the damage occurred- Returns:
- this instance. Allows for chained method calls
- See Also:
-
build
Create a newDamageSource
instance using the supplied parameters.- Returns:
- the damage source instance
-