本文整理汇总了Java中net.minecraft.entity.player.EntityPlayer.getEntityAttribute方法的典型用法代码示例。如果您正苦于以下问题:Java EntityPlayer.getEntityAttribute方法的具体用法?Java EntityPlayer.getEntityAttribute怎么用?Java EntityPlayer.getEntityAttribute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.entity.player.EntityPlayer
的用法示例。
在下文中一共展示了EntityPlayer.getEntityAttribute方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onAdd
import net.minecraft.entity.player.EntityPlayer; //导入方法依赖的package包/类
@Override
public void onAdd(EntityPlayer player, int slot) {
IAttributeInstance attributeHealth = player.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH);
AttributeModifier modifierHealth = new AttributeModifier(UUID.fromString("83cd6b7e-a838-11e7-abc4-cec278b6b50" + slot), "ringOfBloodHealth4" + slot, 4, 0).setSaved(true);
if(!attributeHealth.hasModifier(modifierHealth))
attributeHealth.applyModifier(modifierHealth);
}
示例2: onAdd
import net.minecraft.entity.player.EntityPlayer; //导入方法依赖的package包/类
@Override
public void onAdd(EntityPlayer player, int slot) {
IAttributeInstance attributeHealth = player.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH);
AttributeModifier modifierHealth = new AttributeModifier(UUID.fromString("d20525ee-98b2-402f-b298-61bc19a9e0c5"), "elementalPendantHealth4", 4, 0).setSaved(true);
if(!attributeHealth.hasModifier(modifierHealth))
attributeHealth.applyModifier(modifierHealth);
IAttributeInstance attributeArmour = player.getEntityAttribute(SharedMonsterAttributes.ARMOR);
AttributeModifier modifierArmour = new AttributeModifier(UUID.fromString("82b79e32-3c85-4132-b121-03807793338c"), "elementalPendantArmour2", 2, 0).setSaved(true);
if(!attributeArmour.hasModifier(modifierArmour))
attributeArmour.applyModifier(modifierArmour);
}
示例3: onAdd
import net.minecraft.entity.player.EntityPlayer; //导入方法依赖的package包/类
@Override
public void onAdd(EntityPlayer player, int slot) {
IAttributeInstance attributeHealth = player.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH);
AttributeModifier modifierHealth = new AttributeModifier(UUID.fromString("72eb8438-8f2b-11e7-bb31-be2e44b06b34"), "criminalPendantHealth6", 6, 0).setSaved(true);
if(!attributeHealth.hasModifier(modifierHealth))
attributeHealth.applyModifier(modifierHealth);
}