Interface ItemComponentFunctions

All Superinterfaces:
ComponentFunctions
All Known Subinterfaces:
ItemStackKJS
All Known Implementing Classes:
ItemModificationKubeEvent.ItemModifications, ItemStackMixin

@ReturnsSelf @RemapPrefixForJS("kjs$") public interface ItemComponentFunctions extends ComponentFunctions
  • Method Details

    • kjs$override

      <T> ItemComponentFunctions kjs$override(net.minecraft.core.component.DataComponentType<T> type, @Nullable T value)
      Specified by:
      kjs$override in interface ComponentFunctions
    • kjs$setMaxStackSize

      default ItemComponentFunctions kjs$setMaxStackSize(int size)
    • kjs$setMaxDamage

      default ItemComponentFunctions kjs$setMaxDamage(int maxDamage)
    • kjs$setDamage

      default ItemComponentFunctions kjs$setDamage(int damage)
    • kjs$setUnbreakable

      default ItemComponentFunctions kjs$setUnbreakable()
    • kjs$setUnbreakableWithTooltip

      default ItemComponentFunctions kjs$setUnbreakableWithTooltip()
    • kjs$setItemName

      default ItemComponentFunctions kjs$setItemName(net.minecraft.network.chat.Component component)
    • kjs$setRepairCost

      default ItemComponentFunctions kjs$setRepairCost(int repairCost)
    • kjs$setFood

      default ItemComponentFunctions kjs$setFood(net.minecraft.world.food.FoodProperties foodProperties)
    • kjs$setFood

      default ItemComponentFunctions kjs$setFood(int nutrition, float saturation)
    • kjs$setFireResistant

      default ItemComponentFunctions kjs$setFireResistant()
    • kjs$setTool

      default ItemComponentFunctions kjs$setTool(net.minecraft.world.item.component.Tool tool)
    • kjs$setMapItemColor

      default ItemComponentFunctions kjs$setMapItemColor(KubeColor color)
    • kjs$setChargedProjectiles

      default ItemComponentFunctions kjs$setChargedProjectiles(List<net.minecraft.world.item.ItemStack> items)
    • kjs$setBundleContents

      default ItemComponentFunctions kjs$setBundleContents(List<net.minecraft.world.item.ItemStack> items)
    • kjs$setBucketEntityData

      default ItemComponentFunctions kjs$setBucketEntityData(net.minecraft.nbt.CompoundTag tag)
    • kjs$setBlockEntityData

      default ItemComponentFunctions kjs$setBlockEntityData(net.minecraft.nbt.CompoundTag tag)
    • kjs$setInstrument

      default ItemComponentFunctions kjs$setInstrument(net.minecraft.core.Holder<net.minecraft.world.item.Instrument> instrument)
    • kjs$setFireworkExplosion

      default ItemComponentFunctions kjs$setFireworkExplosion(net.minecraft.world.item.component.FireworkExplosion explosion)
    • kjs$setFireworks

      default ItemComponentFunctions kjs$setFireworks(net.minecraft.world.item.component.Fireworks fireworks)
    • kjs$setNoteBlockSound

      default ItemComponentFunctions kjs$setNoteBlockSound(net.minecraft.resources.ResourceLocation id)
    • kjs$getAttributeModifiers

      default 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

      default ItemComponentFunctions kjs$setAttributeModifiers(List<net.minecraft.world.item.component.ItemAttributeModifiers.Entry> modifiers)
    • kjs$setAttributeModifiersWithTooltip

      default ItemComponentFunctions 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 ItemComponentFunctions 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 ItemComponentFunctions 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 ItemComponentFunctions 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 ItemComponentFunctions kjs$setBaseAttackDamage(double dmg)
    • kjs$getBaseAttackDamage

      default double kjs$getBaseAttackDamage()
    • kjs$getBaseAttackSpeed

      default double kjs$getBaseAttackSpeed()