Class AccessoryEffectBuilder

java.lang.Object
tech.anonymoushacker1279.immersiveweapons.item.accessory.AccessoryEffectBuilder

public class AccessoryEffectBuilder extends Object
Builder for creating accessory effects.
  • Constructor Details

    • AccessoryEffectBuilder

      public AccessoryEffectBuilder()
  • Method Details

    • addEffect

      public AccessoryEffectBuilder addEffect(AccessoryEffectType type, double value)
      Add an effect to the accessory. See AccessoryEffectTypeRegistry for a list of available effects.
      Parameters:
      type - the AccessoryEffectType
      value - the value of the effect
      Returns:
      the EffectBuilder for chaining
    • addEffect

      public AccessoryEffectBuilder addEffect(AccessoryEffectType type, double value, AccessoryEffectScalingType scalingType)
      Add an effect to the accessory. See AccessoryEffectTypeRegistry for a list of available effects. Accepts a scaling type, which will be used to scale the effect value based player conditions.
      Parameters:
      type - the AccessoryEffectType
      value - the value of the effect
      scalingType - the AccessoryEffectScalingType to use
      Returns:
      the EffectBuilder for chaining
    • addAttributeModifier

      public AccessoryEffectBuilder addAttributeModifier(net.minecraft.world.entity.ai.attributes.AttributeModifier modifier, net.minecraft.core.Holder<net.minecraft.world.entity.ai.attributes.Attribute> attribute)
      Add an attribute modifier to the accessory. These are static and unchanging in value.
      Parameters:
      modifier - the AttributeModifier
      attribute - the Attribute
      Returns:
      the EffectBuilder for chaining
    • addDynamicAttributeModifier

      public AccessoryEffectBuilder addDynamicAttributeModifier(net.minecraft.world.entity.ai.attributes.AttributeModifier modifier, net.minecraft.core.Holder<net.minecraft.world.entity.ai.attributes.Attribute> attribute, double targetValue)
      Add a dynamic attribute modifier to the accessory. These are reconstructed as necessary to achieve the target value.
      Parameters:
      modifier - the AttributeModifier
      attribute - the Attribute
      targetValue - the target value of the attribute
      Returns:
      the EffectBuilder for chaining
    • addMobEffect

      public AccessoryEffectBuilder addMobEffect(net.minecraft.world.effect.MobEffectInstance effect)
      Add a mob effect to the accessory.
      Parameters:
      effect - the MobEffectInstance
      Returns:
      the EffectBuilder for chaining
    • addTooltip

      public AccessoryEffectBuilder addTooltip(String key, net.minecraft.ChatFormatting... formats)
      Add a tooltip to the accessory.
      Parameters:
      key - the translation key for the tooltip
      formats - the ChatFormatting to apply to the tooltip
      Returns:
      the EffectBuilder for chaining
    • addObjectsFromBuilder

      public AccessoryEffectBuilder addObjectsFromBuilder(AccessoryEffectBuilder builder)
      Add all effects from another builder to this builder.
      Parameters:
      builder - the EffectBuilder to add from
      Returns:
      the EffectBuilder for chaining
    • getEffects

      public List<AccessoryEffectInstance> getEffects()
    • getAttributeModifiers

      public List<AttributeOperation> getAttributeModifiers()
    • getDynamicAttributeModifiers

      public List<DynamicAttributeOperationInstance> getDynamicAttributeModifiers()
    • getMobEffects

      public List<net.minecraft.world.effect.MobEffectInstance> getMobEffects()
    • getTooltips

      public List<SerializableTooltip> getTooltips()