Class ExpandAttributeInstance

java.lang.Object
com.blamejared.crafttweaker.natives.entity.attribute.ExpandAttributeInstance

@ZenRegister public class ExpandAttributeInstance extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    addPermanentModifier(net.minecraft.world.entity.ai.attributes.AttributeInstance internal, net.minecraft.world.entity.ai.attributes.AttributeModifier modifier)
    Adds a permanent AttributeModifier to the attribute.
    static void
    addTransientModifier(net.minecraft.world.entity.ai.attributes.AttributeInstance internal, net.minecraft.world.entity.ai.attributes.AttributeModifier modifier)
    Adds a transient AttributeModifier to the attribute.
    static double
    getBaseValue(net.minecraft.world.entity.ai.attributes.AttributeInstance internal)
    Gets the base value of the attribute.
    static net.minecraft.world.entity.ai.attributes.AttributeModifier
    getModifier(net.minecraft.world.entity.ai.attributes.AttributeInstance internal, net.minecraft.resources.ResourceLocation id)
    Gets the AttributeModifier with the given ID.
    static List<net.minecraft.world.entity.ai.attributes.AttributeModifier>
    getModifiers(net.minecraft.world.entity.ai.attributes.AttributeInstance internal)
    Gets the AttributeModifier of the attribute.
    static double
    getValue(net.minecraft.world.entity.ai.attributes.AttributeInstance internal)
    Gets the current value of the attribute.
    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.
    static void
    removeModifier(net.minecraft.world.entity.ai.attributes.AttributeInstance internal, net.minecraft.resources.ResourceLocation id)
    Removes the AttributeModifier with the given ID.
    static void
    setBaseValue(net.minecraft.world.entity.ai.attributes.AttributeInstance internal, double value)
    Sets the base value of the attribute.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 the AttributeModifier of 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 transient AttributeModifier to 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 permanent AttributeModifier to 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 the AttributeModifier with the given ID.
      Parameters:
      id - The ID of the modifier to get.
      Returns:
      The AttributeModifier with 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 the AttributeModifier with the given ID.
      Parameters:
      id - The ID of the modifier to remove.