Floor values are set for max health, combat regen, health regen, melee damage, and projectile damage when changing them now.

This commit is contained in:
luisc committed 2021-12-04 12:46:53 -06:00
1 parent cd5b4c0633
commit 3c1bc30e44
6 files changed
+16 -12

No files matched your search

@@ -1,6 +1,7 @@
package noppes.npcs.scripted.entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
@@ -49,8 +50,8 @@ public class ScriptLivingBase<T extends EntityLivingBase> extends ScriptEntity<T
/**
* @return Entity's max health
*/
public float getMaxHealth(){
return entity.getMaxHealth();
public double getMaxHealth(){
return entity.getEntityAttribute(SharedMonsterAttributes.maxHealth).getAttributeValue();
}
/**
* @return Whether or not this entity is attacking something