public class DamageEventData extends EventData
构造器和说明 |
---|
DamageEventData(LivingEntity entity,
LivingEntity damager,
String entityName,
String damagerName,
SXAttributeData entityData,
SXAttributeData damagerData,
EntityDamageByEntityEvent event) |
限定符和类型 | 方法和说明 |
---|---|
void |
addDamage(double addDamage)
增加伤害值
|
LivingEntity |
getDamager()
获取攻击方
|
double[] |
getDamagerAttributeDoubles(String attributeName)
获取攻击方的属性值
|
String |
getDamagerName()
获取攻击方名字
|
List<String> |
getEffectiveAttributeList()
获取被触发的效果
|
LivingEntity |
getEntity()
获取防御方
|
double[] |
getEntityAttributeDoubles(String attributeName)
获取防御方的属性值
|
String |
getEntityName()
获取防御方名字
|
EntityDamageByEntityEvent |
getEvent()
获取原事件
注意,事件内的FinalDamage是无效的
|
void |
sendHolo(String message)
输出一个全息文本
|
void |
setCancelled(boolean cancelled)
取消该事件 剩下的属性不会执行方法
|
void |
takeDamage(double takeDamage)
减少伤害值
|
public DamageEventData(LivingEntity entity, LivingEntity damager, String entityName, String damagerName, SXAttributeData entityData, SXAttributeData damagerData, EntityDamageByEntityEvent event)
public void sendHolo(String message)
message
- Stringpublic double[] getEntityAttributeDoubles(String attributeName)
attributeName
- Stringpublic double[] getDamagerAttributeDoubles(String attributeName)
attributeName
- Stringpublic void addDamage(double addDamage)
addDamage
- doublepublic void takeDamage(double takeDamage)
takeDamage
- doublepublic LivingEntity getEntity()
public LivingEntity getDamager()
public String getEntityName()
public String getDamagerName()
public EntityDamageByEntityEvent getEvent()
public void setCancelled(boolean cancelled)
cancelled
- boolean