Class AccessoryItem.EffectBuilder
java.lang.Object
tech.anonymoushacker1279.immersiveweapons.item.AccessoryItem.EffectBuilder
- Enclosing class:
- AccessoryItem
Builder for creating effects.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumAn enum of scaling types for effects. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddAttributeModifier(net.minecraft.world.entity.ai.attributes.AttributeModifier modifier, 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.world.entity.ai.attributes.Attribute attribute, double targetValue) Add a dynamic attribute modifier to the accessory.addEffect(AccessoryItem.EffectType type, double value) Add an effect to the accessory.addEffect(AccessoryItem.EffectType type, double value, AccessoryItem.EffectBuilder.EffectScalingType 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.Map<net.minecraft.world.entity.ai.attributes.AttributeModifier,net.minecraft.world.entity.ai.attributes.Attribute> Map<Map<net.minecraft.world.entity.ai.attributes.AttributeModifier,net.minecraft.world.entity.ai.attributes.Attribute>, Double> List<net.minecraft.world.effect.MobEffectInstance>
-
Constructor Details
-
EffectBuilder
public EffectBuilder()
-
-
Method Details
-
addEffect
Add an effect to the accessory. SeeAccessoryItem.EffectTypefor a list of available effects.- Parameters:
type- theEffectTypevalue- the value of the effect- Returns:
- the
EffectBuilderfor chaining
-
addEffect
public AccessoryItem.EffectBuilder addEffect(AccessoryItem.EffectType type, double value, AccessoryItem.EffectBuilder.EffectScalingType scalingType) Add an effect to the accessory. SeeAccessoryItem.EffectTypefor a list of available effects. Accepts a scaling type, which will be used to scale the effect value based player conditions.- Parameters:
type- theEffectTypevalue- the value of the effectscalingType- theEffectScalingType- Returns:
- the
EffectBuilderfor chaining
-
addAttributeModifier
public AccessoryItem.EffectBuilder addAttributeModifier(net.minecraft.world.entity.ai.attributes.AttributeModifier modifier, 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 AccessoryItem.EffectBuilder addDynamicAttributeModifier(net.minecraft.world.entity.ai.attributes.AttributeModifier modifier, 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
public AccessoryItem.EffectBuilder addMobEffect(net.minecraft.world.effect.MobEffectInstance effect) Add a mob effect to the accessory.- Parameters:
effect- theMobEffectInstance- Returns:
- the
EffectBuilderfor chaining
-
addObjectsFromBuilder
Add all effects from another builder to this builder.- Parameters:
builder- theEffectBuilderto add from- Returns:
- the
EffectBuilderfor chaining
-
getEffects
-
getEffectScalingTypes
public Map<AccessoryItem.EffectType,AccessoryItem.EffectBuilder.EffectScalingType> getEffectScalingTypes() -
getAttributeModifiers
public Map<net.minecraft.world.entity.ai.attributes.AttributeModifier,net.minecraft.world.entity.ai.attributes.Attribute> getAttributeModifiers() -
getDynamicAttributeModifiers
-
getMobEffects
-