Java Code Examples for net.minecraft.entity.player.EntityPlayer.getEntityAttribute()

The following are Jave code examples for showing how to use getEntityAttribute() of the net.minecraft.entity.player.EntityPlayer class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: harshencastle   File: RingOfBlood.java   View Source Code Vote up 5 votes
@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);
	
}
 
Example 2
Project: harshencastle   File: ElementalPendant.java   View Source Code Vote up 5 votes
@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);
}
 
Example 3
Project: harshencastle   File: CriminalPendant.java   View Source Code Vote up 5 votes
@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);
}