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