接口 DamageSource.Builder
- 封闭接口:
- DamageSource
public static interface DamageSource.Builder
使构建
DamageSource更容易的工具类. 只需要一个DamageType.-
方法概要
修饰符和类型方法说明build()使用提供的参数创建一个新的DamageSource实例.withCausingEntity(@NotNull Entity entity) 设置造成伤害的Entity.withDamageLocation(@NotNull Location location) 设置伤害来源的Location.withDirectEntity(@NotNull Entity entity) 设置直接造成伤害的Entity.
-
方法详细资料
-
withCausingEntity
- 参数:
entity- 实体- 返回:
- 此实例. 允许链式方法调用
- 另请参阅:
-
withDirectEntity
- 参数:
entity- 实体- 返回:
- 此实例. 允许链式方法调用
- 另请参阅:
-
withDamageLocation
- 参数:
location- 伤害发生的位置- 返回:
- 此实例. 允许链式方法调用
- 另请参阅:
-
build
使用提供的参数创建一个新的DamageSource实例.原文: Create a new
DamageSourceinstance using the supplied parameters.- 返回:
- 伤害来源实例
-