Interface AttributeModifierFunctions
- All Known Subinterfaces:
ItemComponentFunctions,ItemStackKJS
- All Known Implementing Classes:
ItemModificationKubeEvent.ItemModifications,ItemStackMixin
@RemapPrefixForJS("kjs$")
@ReturnsSelf
public interface AttributeModifierFunctions
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidkjs$addAttributeModifier(net.minecraft.core.Holder<net.minecraft.world.entity.ai.attributes.Attribute> attribute, net.minecraft.world.entity.ai.attributes.AttributeModifier mod, net.minecraft.world.entity.EquipmentSlotGroup slot) default doubledefault doubledefault @Nullable net.minecraft.world.entity.ai.attributes.AttributeModifierkjs$getAttributeModifier(net.minecraft.core.Holder<net.minecraft.world.entity.ai.attributes.Attribute> attribute, net.minecraft.resources.ResourceLocation id) net.minecraft.world.item.component.ItemAttributeModifiersdefault doubledefault doubledefault booleankjs$hasAttributeModifier(net.minecraft.core.Holder<net.minecraft.world.entity.ai.attributes.Attribute> attribute, net.minecraft.resources.ResourceLocation id) default voidkjs$setAttackDamage(double dmg) default voidkjs$setAttackSpeed(double speed) default voidkjs$setAttributeModifiers(List<net.minecraft.world.item.component.ItemAttributeModifiers.Entry> modifiers) voidkjs$setAttributeModifiers(net.minecraft.world.item.component.ItemAttributeModifiers modifiers) default voidkjs$setAttributeModifiersWithTooltip(List<net.minecraft.world.item.component.ItemAttributeModifiers.Entry> modifiers) default voidkjs$setBaseAttackDamage(double dmg) default voidkjs$setBaseAttackSpeed(double speed)
-
Method Details
-
kjs$getAttributeModifiers
net.minecraft.world.item.component.ItemAttributeModifiers kjs$getAttributeModifiers() -
kjs$hasAttributeModifier
default boolean kjs$hasAttributeModifier(net.minecraft.core.Holder<net.minecraft.world.entity.ai.attributes.Attribute> attribute, net.minecraft.resources.ResourceLocation id) -
kjs$getAttributeModifier
@Nullable default @Nullable net.minecraft.world.entity.ai.attributes.AttributeModifier kjs$getAttributeModifier(net.minecraft.core.Holder<net.minecraft.world.entity.ai.attributes.Attribute> attribute, net.minecraft.resources.ResourceLocation id) -
kjs$setAttributeModifiers
@HideFromJS void kjs$setAttributeModifiers(net.minecraft.world.item.component.ItemAttributeModifiers modifiers) -
kjs$addAttributeModifier
default void kjs$addAttributeModifier(net.minecraft.core.Holder<net.minecraft.world.entity.ai.attributes.Attribute> attribute, net.minecraft.world.entity.ai.attributes.AttributeModifier mod, net.minecraft.world.entity.EquipmentSlotGroup slot) -
kjs$setAttributeModifiers
@NonExtendable default void kjs$setAttributeModifiers(List<net.minecraft.world.item.component.ItemAttributeModifiers.Entry> modifiers) -
kjs$setAttributeModifiersWithTooltip
@NonExtendable default void kjs$setAttributeModifiersWithTooltip(List<net.minecraft.world.item.component.ItemAttributeModifiers.Entry> modifiers) -
kjs$setAttackSpeed
@Info("Sets the attack speed of this item to the given value, **removing** all other modifiers to attack speed.\nNote that players have a default attack speed of 4.0, so this modifier is added on top of that.\n(Example: Swords have an attack speed of -2.4, leading to a total value of 1.6 without any other changes.)\n") default void kjs$setAttackSpeed(double speed) -
kjs$setAttackDamage
@Info("Sets the attack damage of this item to the given value, **removing** all other modifiers to attack damage.\nNote that since players have a default attack damage of 1.0, total damage will be (dmg + 1.0) before other modifiers.\n(In practice, this simply means that most weapons have this value set to 1 less than what you might think.)\n") default void kjs$setAttackDamage(double dmg) -
kjs$getAttackDamage
default double kjs$getAttackDamage() -
kjs$getAttackSpeed
default double kjs$getAttackSpeed() -
kjs$setBaseAttackSpeed
@Info("Overrides the *base* attack speed of this item to be the given value, keeping other modifiers intact.\nNote that players have a default attack speed of 4.0, so this modifier is added on top of that.\n") default void kjs$setBaseAttackSpeed(double speed) -
kjs$setBaseAttackDamage
@Info("Overrides the *base* attack damage of this item to be the given value, keeping other modifiers intact.\nNote that since players have a default attack damage of 1.0, total damage will be (dmg + 1.0) before other modifiers.\n") default void kjs$setBaseAttackDamage(double dmg) -
kjs$getBaseAttackDamage
default double kjs$getBaseAttackDamage() -
kjs$getBaseAttackSpeed
default double kjs$getBaseAttackSpeed()
-