Class ExpandAttributeInstance
java.lang.Object
com.blamejared.crafttweaker.natives.entity.attribute.ExpandAttributeInstance
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddPermanentModifier(net.minecraft.world.entity.ai.attributes.AttributeInstance internal, net.minecraft.world.entity.ai.attributes.AttributeModifier modifier) Adds a permanentAttributeModifierto the attribute.static voidaddTransientModifier(net.minecraft.world.entity.ai.attributes.AttributeInstance internal, net.minecraft.world.entity.ai.attributes.AttributeModifier modifier) Adds a transientAttributeModifierto the attribute.static doublegetBaseValue(net.minecraft.world.entity.ai.attributes.AttributeInstance internal) Gets the base value of the attribute.static net.minecraft.world.entity.ai.attributes.AttributeModifiergetModifier(net.minecraft.world.entity.ai.attributes.AttributeInstance internal, net.minecraft.resources.ResourceLocation id) Gets theAttributeModifierwith the given ID.static List<net.minecraft.world.entity.ai.attributes.AttributeModifier> getModifiers(net.minecraft.world.entity.ai.attributes.AttributeInstance internal) Gets theAttributeModifierof the attribute.static doublegetValue(net.minecraft.world.entity.ai.attributes.AttributeInstance internal) Gets the current value of the attribute.static booleanhasModifier(net.minecraft.world.entity.ai.attributes.AttributeInstance internal, net.minecraft.resources.ResourceLocation id) Checks if the attribute has a modifier with the given ID.static voidremoveModifier(net.minecraft.world.entity.ai.attributes.AttributeInstance internal, net.minecraft.resources.ResourceLocation id) Removes theAttributeModifierwith the given ID.static voidsetBaseValue(net.minecraft.world.entity.ai.attributes.AttributeInstance internal, double value) Sets the base value of the attribute.
-
Constructor Details
-
ExpandAttributeInstance
public ExpandAttributeInstance()
-
-
Method Details
-
getBaseValue
public static double getBaseValue(net.minecraft.world.entity.ai.attributes.AttributeInstance internal) Gets the base value of the attribute.- Returns:
- The base value of the attribute.
-
setBaseValue
public static void setBaseValue(net.minecraft.world.entity.ai.attributes.AttributeInstance internal, double value) Sets the base value of the attribute.- Parameters:
value- The new base value of the attribute.
-
getValue
public static double getValue(net.minecraft.world.entity.ai.attributes.AttributeInstance internal) Gets the current value of the attribute.- Returns:
- The current value of the attribute.
-
getModifiers
public static List<net.minecraft.world.entity.ai.attributes.AttributeModifier> getModifiers(net.minecraft.world.entity.ai.attributes.AttributeInstance internal) Gets theAttributeModifierof the attribute.- Returns:
- The modifiers of the attribute.
-
addTransientModifier
public static void addTransientModifier(net.minecraft.world.entity.ai.attributes.AttributeInstance internal, net.minecraft.world.entity.ai.attributes.AttributeModifier modifier) Adds a transientAttributeModifierto the attribute.- Parameters:
modifier- The modifier to add.
-
addPermanentModifier
public static void addPermanentModifier(net.minecraft.world.entity.ai.attributes.AttributeInstance internal, net.minecraft.world.entity.ai.attributes.AttributeModifier modifier) Adds a permanentAttributeModifierto the attribute.- Parameters:
modifier- The modifier to add.
-
hasModifier
public static boolean hasModifier(net.minecraft.world.entity.ai.attributes.AttributeInstance internal, net.minecraft.resources.ResourceLocation id) Checks if the attribute has a modifier with the given ID.- Parameters:
id- The ID of the modifier to check for.- Returns:
- True if the attribute has a modifier with the given ID, false otherwise.
-
getModifier
public static net.minecraft.world.entity.ai.attributes.AttributeModifier getModifier(net.minecraft.world.entity.ai.attributes.AttributeInstance internal, net.minecraft.resources.ResourceLocation id) Gets theAttributeModifierwith the given ID.- Parameters:
id- The ID of the modifier to get.- Returns:
- The
AttributeModifierwith the given ID, or null if it does not exist.
-
removeModifier
public static void removeModifier(net.minecraft.world.entity.ai.attributes.AttributeInstance internal, net.minecraft.resources.ResourceLocation id) Removes theAttributeModifierwith the given ID.- Parameters:
id- The ID of the modifier to remove.
-