use of net.minecraft.entity.attribute.EntityAttribute in project artifality by PinkGoosik.
the class LunarElement method onInit.
@Override
public void onInit(LivingEntity entity, World world) {
Multimap<EntityAttribute, EntityAttributeModifier> attributes;
ImmutableMultimap.Builder<EntityAttribute, EntityAttributeModifier> builder = ImmutableMultimap.builder();
builder.put(EntityAttributes.GENERIC_MAX_HEALTH, new EntityAttributeModifier("Element modifier", 15, EntityAttributeModifier.Operation.ADDITION));
attributes = builder.build();
entity.getAttributes().addTemporaryModifiers(attributes);
entity.heal(15);
}
use of net.minecraft.entity.attribute.EntityAttribute in project artifality by PinkGoosik.
the class LifeElement method onInit.
@Override
public void onInit(LivingEntity entity, World world) {
Multimap<EntityAttribute, EntityAttributeModifier> attributes;
ImmutableMultimap.Builder<EntityAttribute, EntityAttributeModifier> builder = ImmutableMultimap.builder();
builder.put(EntityAttributes.GENERIC_MAX_HEALTH, new EntityAttributeModifier("Element modifier", 30, EntityAttributeModifier.Operation.ADDITION));
attributes = builder.build();
entity.getAttributes().addTemporaryModifiers(attributes);
entity.heal(30);
}
Aggregations