Class AccessoryEffectBuilder
java.lang.Object
tech.anonymoushacker1279.immersiveweapons.item.accessory.AccessoryEffectBuilder
Builder for creating accessory effects.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddAttributeModifier(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.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.addEffect(AccessoryEffectType type, double value) Add an effect to the accessory.addEffect(AccessoryEffectType type, double value, AccessoryEffectScalingType scalingType) Add an effect to the accessory.addMobEffect(net.minecraft.world.effect.MobEffectInstance effect) Add a mob effect to the accessory.Add all effects from another builder to this builder.addTooltip(String key, net.minecraft.ChatFormatting... formats) Add a tooltip to the accessory.List<net.minecraft.world.effect.MobEffectInstance>
-
Constructor Details
-
AccessoryEffectBuilder
public AccessoryEffectBuilder()
-
-
Method Details
-
addEffect
Add an effect to the accessory. SeeAccessoryEffectTypeRegistryfor a list of available effects.- Parameters:
type- theAccessoryEffectTypevalue- the value of the effect- Returns:
- the
EffectBuilderfor chaining
-
addEffect
public AccessoryEffectBuilder addEffect(AccessoryEffectType type, double value, AccessoryEffectScalingType scalingType) Add an effect to the accessory. SeeAccessoryEffectTypeRegistryfor a list of available effects. Accepts a scaling type, which will be used to scale the effect value based player conditions.- Parameters:
type- theAccessoryEffectTypevalue- the value of the effectscalingType- theAccessoryEffectScalingTypeto use- Returns:
- the
EffectBuilderfor 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- theAttributeModifierattribute- theAttribute- Returns:
- the
EffectBuilderfor 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- theAttributeModifierattribute- theAttributetargetValue- the target value of the attribute- Returns:
- the
EffectBuilderfor chaining
-
addMobEffect
Add a mob effect to the accessory.- Parameters:
effect- theMobEffectInstance- Returns:
- the
EffectBuilderfor chaining
-
addTooltip
Add a tooltip to the accessory.- Parameters:
key- the translation key for the tooltipformats- theChatFormattingto apply to the tooltip- Returns:
- the
EffectBuilderfor chaining
-
addObjectsFromBuilder
Add all effects from another builder to this builder.- Parameters:
builder- theEffectBuilderto add from- Returns:
- the
EffectBuilderfor chaining
-
getEffects
-
getAttributeModifiers
-
getDynamicAttributeModifiers
-
getMobEffects
-
getTooltips
-