Class FabricItemSettings

java.lang.Object
net.minecraft.item.Item.Settings
net.fabricmc.fabric.api.item.v1.FabricItemSettings

public class FabricItemSettings extends net.minecraft.item.Item.Settings
Fabric's version of Item.Settings. Adds additional methods and hooks not found in the original class.

To use it, simply replace new Item.Settings() with new FabricItemSettings().

  • Constructor Details

    • FabricItemSettings

      public FabricItemSettings()
  • Method Details

    • equipmentSlot

      public FabricItemSettings equipmentSlot(EquipmentSlotProvider equipmentSlotProvider)
      Sets the equipment slot provider of the item.
      Parameters:
      equipmentSlotProvider - the equipment slot provider
      Returns:
      this builder
    • customDamage

      public FabricItemSettings customDamage(CustomDamageHandler handler)
      Sets the custom damage handler of the item. Note that this is only called on an ItemStack if ItemStack.isDamageable() returns true.
      See Also:
    • food

      public FabricItemSettings food(net.minecraft.item.FoodComponent foodComponent)
      Overrides:
      food in class net.minecraft.item.Item.Settings
    • maxCount

      public FabricItemSettings maxCount(int maxCount)
      Overrides:
      maxCount in class net.minecraft.item.Item.Settings
    • maxDamageIfAbsent

      public FabricItemSettings maxDamageIfAbsent(int maxDamage)
      Overrides:
      maxDamageIfAbsent in class net.minecraft.item.Item.Settings
    • maxDamage

      public FabricItemSettings maxDamage(int maxDamage)
      Overrides:
      maxDamage in class net.minecraft.item.Item.Settings
    • recipeRemainder

      public FabricItemSettings recipeRemainder(net.minecraft.item.Item recipeRemainder)
      Overrides:
      recipeRemainder in class net.minecraft.item.Item.Settings
    • group

      public FabricItemSettings group(net.minecraft.item.ItemGroup group)
      Overrides:
      group in class net.minecraft.item.Item.Settings
    • rarity

      public FabricItemSettings rarity(net.minecraft.util.Rarity rarity)
      Overrides:
      rarity in class net.minecraft.item.Item.Settings
    • fireproof

      public FabricItemSettings fireproof()
      Overrides:
      fireproof in class net.minecraft.item.Item.Settings