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 newDamageSourceinstance using the supplied parameters.withCausingEntity(Entity entity) Set theEntitythat caused the damage.withDamageLocation(Location location) Set theLocationof the source of damage.withDirectEntity(Entity entity) Set theEntitythat directly inflicted the damage.
-
Method Details
-
withCausingEntity
Set theEntitythat caused the damage.- Parameters:
entity- the entity- Returns:
- this instance. Allows for chained method calls
- See Also:
-
withDirectEntity
Set theEntitythat directly inflicted the damage.- Parameters:
entity- the entity- Returns:
- this instance. Allows for chained method calls
- See Also:
-
withDamageLocation
Set theLocationof 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 newDamageSourceinstance using the supplied parameters.- Returns:
- the damage source instance
-