接口 DamageSource.Builder
- 封闭接口:
- DamageSource
public static interface DamageSource.Builder
Utility class to make building a
DamageSource easier. Only a
DamageType is required.-
方法概要
修饰符和类型方法说明build()Create a newDamageSourceinstance using the supplied parameters.withCausingEntity(@NotNull Entity entity) Set theEntitythat caused the damage.withDamageLocation(@NotNull Location location) Set theLocationof the source of damage.withDirectEntity(@NotNull Entity entity) Set theEntitythat directly inflicted the damage.
-
方法详细资料
-
withCausingEntity
Set theEntitythat caused the damage.- 参数:
entity- the entity- 返回:
- this instance. Allows for chained method calls
- 另请参阅:
-
withDirectEntity
Set theEntitythat directly inflicted the damage.- 参数:
entity- the entity- 返回:
- this instance. Allows for chained method calls
- 另请参阅:
-
withDamageLocation
Set theLocationof the source of damage.- 参数:
location- the location where the damage occurred- 返回:
- this instance. Allows for chained method calls
- 另请参阅:
-
build
Create a newDamageSourceinstance using the supplied parameters.- 返回:
- the damage source instance
-