@SubscribeEvent(priority = EventPriority.HIGHEST)
public void updateSoulDrain(final LivingSpawnEvent event) {
if (event.world.isRemote) {
return;
}
if (!EntityPlayerMP.class.equals(event.getClass())) {
return;
}
final IAttributeInstance a = event.entityLiving.getAttributeMap().getAttributeInstanceByName(SharedMonsterAttributes.maxHealth.getAttributeUnlocalizedName());
final AttributeModifier attr = a.getModifier(ItemSoul.uuid);
if (attr == null || attr.getOperation() == 2) {
return;
}
final double l = attr.getAmount() / 20.0;
a.removeModifier(attr);
a.applyModifier(new AttributeModifier(ItemSoul.uuid, "Missing Soul", l, 0));
}
EventHandlerServer.java 文件源码
java
阅读 28
收藏 0
点赞 0
评论 0
项目:ExtraUtilities
作者:
评论列表
文章目录