Class Item.Settings

java.lang.Object
net.minecraft.item.Item.Settings
Enclosing class:
Item

public static class Item.Settings extends Object
Item settings configure behaviors common to all items, such as the stack's max count. An instance of this must be passed to the constructor of Item (or most of its subclasses).
Mappings:
Namespace Name
named net/minecraft/item/Item$Settings
intermediary net/minecraft/class_1792$class_1793
official cxk$a
  • Field Details

    • BLOCK_PREFIXED_TRANSLATION_KEY

      private static final RegistryKeyedValue<Item,String> BLOCK_PREFIXED_TRANSLATION_KEY
      Mappings:
      Namespace Name Mixin selector
      named BLOCK_PREFIXED_TRANSLATION_KEY Lnet/minecraft/item/Item$Settings;BLOCK_PREFIXED_TRANSLATION_KEY:Lnet/minecraft/registry/RegistryKeyedValue;
      intermediary field_54115 Lnet/minecraft/class_1792$class_1793;field_54115:Lnet/minecraft/class_10162;
      official a Lcxk$a;a:Lalr;
    • ITEM_PREFIXED_TRANSLATION_KEY

      private static final RegistryKeyedValue<Item,String> ITEM_PREFIXED_TRANSLATION_KEY
      Mappings:
      Namespace Name Mixin selector
      named ITEM_PREFIXED_TRANSLATION_KEY Lnet/minecraft/item/Item$Settings;ITEM_PREFIXED_TRANSLATION_KEY:Lnet/minecraft/registry/RegistryKeyedValue;
      intermediary field_54116 Lnet/minecraft/class_1792$class_1793;field_54116:Lnet/minecraft/class_10162;
      official b Lcxk$a;b:Lalr;
    • components

      private final ComponentMap.Builder components
      Mappings:
      Namespace Name Mixin selector
      named components Lnet/minecraft/item/Item$Settings;components:Lnet/minecraft/component/ComponentMap$Builder;
      intermediary field_49265 Lnet/minecraft/class_1792$class_1793;field_49265:Lnet/minecraft/class_9323$class_9324;
      official c Lcxk$a;c:Lkq$a;
    • recipeRemainder

      @Nullable @Nullable Item recipeRemainder
      Mappings:
      Namespace Name Mixin selector
      named recipeRemainder Lnet/minecraft/item/Item$Settings;recipeRemainder:Lnet/minecraft/item/Item;
      intermediary field_8018 Lnet/minecraft/class_1792$class_1793;field_8018:Lnet/minecraft/class_1792;
      official d Lcxk$a;d:Lcxk;
    • requiredFeatures

      FeatureSet requiredFeatures
      Mappings:
      Namespace Name Mixin selector
      named requiredFeatures Lnet/minecraft/item/Item$Settings;requiredFeatures:Lnet/minecraft/resource/featuretoggle/FeatureSet;
      intermediary field_40210 Lnet/minecraft/class_1792$class_1793;field_40210:Lnet/minecraft/class_7699;
      official e Lcxk$a;e:Lcss;
    • registryKey

      @Nullable private @Nullable RegistryKey<Item> registryKey
      Mappings:
      Namespace Name Mixin selector
      named registryKey Lnet/minecraft/item/Item$Settings;registryKey:Lnet/minecraft/registry/RegistryKey;
      intermediary field_54117 Lnet/minecraft/class_1792$class_1793;field_54117:Lnet/minecraft/class_5321;
      official f Lcxk$a;f:Laly;
    • translationKey

      private RegistryKeyedValue<Item,String> translationKey
      Mappings:
      Namespace Name Mixin selector
      named translationKey Lnet/minecraft/item/Item$Settings;translationKey:Lnet/minecraft/registry/RegistryKeyedValue;
      intermediary field_54118 Lnet/minecraft/class_1792$class_1793;field_54118:Lnet/minecraft/class_10162;
      official g Lcxk$a;g:Lalr;
    • modelId

      Mappings:
      Namespace Name Mixin selector
      named modelId Lnet/minecraft/item/Item$Settings;modelId:Lnet/minecraft/registry/RegistryKeyedValue;
      intermediary field_54119 Lnet/minecraft/class_1792$class_1793;field_54119:Lnet/minecraft/class_10162;
      official h Lcxk$a;h:Lalr;
  • Constructor Details

    • Settings

      public Settings()
  • Method Details

    • food

      public Item.Settings food(FoodComponent foodComponent)
      When set, any item configured with this Settings instance will be edible based on the provided FoodComponent.
      Parameters:
      foodComponent - configured food properties for any item using this Settings instance
      Returns:
      this instance
      Mappings:
      Namespace Name Mixin selector
      named food Lnet/minecraft/item/Item$Settings;food(Lnet/minecraft/component/type/FoodComponent;)Lnet/minecraft/item/Item$Settings;
      intermediary method_19265 Lnet/minecraft/class_1792$class_1793;method_19265(Lnet/minecraft/class_4174;)Lnet/minecraft/class_1792$class_1793;
      official a Lcxk$a;a(Lcsy;)Lcxk$a;
    • food

      public Item.Settings food(FoodComponent foodComponent, ConsumableComponent consumableComponent)
      Mappings:
      Namespace Name Mixin selector
      named food Lnet/minecraft/item/Item$Settings;food(Lnet/minecraft/component/type/FoodComponent;Lnet/minecraft/component/type/ConsumableComponent;)Lnet/minecraft/item/Item$Settings;
      intermediary method_62833 Lnet/minecraft/class_1792$class_1793;method_62833(Lnet/minecraft/class_4174;Lnet/minecraft/class_10124;)Lnet/minecraft/class_1792$class_1793;
      official a Lcxk$a;a(Lcsy;Lczu;)Lcxk$a;
    • useRemainder

      public Item.Settings useRemainder(Item convertInto)
      Mappings:
      Namespace Name Mixin selector
      named useRemainder Lnet/minecraft/item/Item$Settings;useRemainder(Lnet/minecraft/item/Item;)Lnet/minecraft/item/Item$Settings;
      intermediary method_62834 Lnet/minecraft/class_1792$class_1793;method_62834(Lnet/minecraft/class_1792;)Lnet/minecraft/class_1792$class_1793;
      official a Lcxk$a;a(Lcxk;)Lcxk$a;
    • useCooldown

      public Item.Settings useCooldown(float seconds)
      Mappings:
      Namespace Name Mixin selector
      named useCooldown Lnet/minecraft/item/Item$Settings;useCooldown(F)Lnet/minecraft/item/Item$Settings;
      intermediary method_62832 Lnet/minecraft/class_1792$class_1793;method_62832(F)Lnet/minecraft/class_1792$class_1793;
      official a Lcxk$a;a(F)Lcxk$a;
    • maxCount

      public Item.Settings maxCount(int maxCount)
      Sets the maximum stack count of any ItemStack with an Item using this Settings instance.

      Note that a count over 64 leads to unreliable behavior in GUIs. Damageable items can not have a maximum stack count (they default to 1). An Item.Settings' max count defaults to 64.

      Parameters:
      maxCount - maximum stack count of any ItemStack with an item using this Settings instance
      Returns:
      this instance
      Throws:
      RuntimeException - if this Settings instance also has a max damage value set
      Mappings:
      Namespace Name Mixin selector
      named maxCount Lnet/minecraft/item/Item$Settings;maxCount(I)Lnet/minecraft/item/Item$Settings;
      intermediary method_7889 Lnet/minecraft/class_1792$class_1793;method_7889(I)Lnet/minecraft/class_1792$class_1793;
      official a Lcxk$a;a(I)Lcxk$a;
    • maxDamage

      public Item.Settings maxDamage(int maxDamage)
      Sets the maximum durability of any item configured with this Settings instance.

      Note that max stack count is set to 1 when this method is called.

      Parameters:
      maxDamage - maximum durability of an ItemStack using an item with this Item.Settings instance
      Returns:
      this instance
      Mappings:
      Namespace Name Mixin selector
      named maxDamage Lnet/minecraft/item/Item$Settings;maxDamage(I)Lnet/minecraft/item/Item$Settings;
      intermediary method_7895 Lnet/minecraft/class_1792$class_1793;method_7895(I)Lnet/minecraft/class_1792$class_1793;
      official b Lcxk$a;b(I)Lcxk$a;
    • recipeRemainder

      public Item.Settings recipeRemainder(Item recipeRemainder)
      Sets the recipe remainder for any item configured with this Settings instance. When an item with a recipe remainder is used in a crafting recipe, the remainder is left in the table or returned to the player.
      Returns:
      this instance
      Mappings:
      Namespace Name Mixin selector
      named recipeRemainder Lnet/minecraft/item/Item$Settings;recipeRemainder(Lnet/minecraft/item/Item;)Lnet/minecraft/item/Item$Settings;
      intermediary method_7896 Lnet/minecraft/class_1792$class_1793;method_7896(Lnet/minecraft/class_1792;)Lnet/minecraft/class_1792$class_1793;
      official b Lcxk$a;b(Lcxk;)Lcxk$a;
    • rarity

      public Item.Settings rarity(Rarity rarity)
      Sets the Rarity of any item configured with this Settings instance, which changes the color of its name.

      An item's rarity defaults to Rarity.COMMON.

      Parameters:
      rarity - rarity to apply to items using this Settings instance
      Returns:
      this instance
      Mappings:
      Namespace Name Mixin selector
      named rarity Lnet/minecraft/item/Item$Settings;rarity(Lnet/minecraft/util/Rarity;)Lnet/minecraft/item/Item$Settings;
      intermediary method_7894 Lnet/minecraft/class_1792$class_1793;method_7894(Lnet/minecraft/class_1814;)Lnet/minecraft/class_1792$class_1793;
      official a Lcxk$a;a(Lcyl;)Lcxk$a;
    • fireproof

      public Item.Settings fireproof()
      If called, any item with this Settings instance is immune to fire and lava damage.
      Returns:
      this instance
      Mappings:
      Namespace Name Mixin selector
      named fireproof Lnet/minecraft/item/Item$Settings;fireproof()Lnet/minecraft/item/Item$Settings;
      intermediary method_24359 Lnet/minecraft/class_1792$class_1793;method_24359()Lnet/minecraft/class_1792$class_1793;
      official a Lcxk$a;a()Lcxk$a;
    • jukeboxPlayable

      public Item.Settings jukeboxPlayable(RegistryKey<JukeboxSong> songKey)
      Mappings:
      Namespace Name Mixin selector
      named jukeboxPlayable Lnet/minecraft/item/Item$Settings;jukeboxPlayable(Lnet/minecraft/registry/RegistryKey;)Lnet/minecraft/item/Item$Settings;
      intermediary method_60745 Lnet/minecraft/class_1792$class_1793;method_60745(Lnet/minecraft/class_5321;)Lnet/minecraft/class_1792$class_1793;
      official a Lcxk$a;a(Laly;)Lcxk$a;
    • enchantable

      public Item.Settings enchantable(int enchantability)
      Mappings:
      Namespace Name Mixin selector
      named enchantable Lnet/minecraft/item/Item$Settings;enchantable(I)Lnet/minecraft/item/Item$Settings;
      intermediary method_61649 Lnet/minecraft/class_1792$class_1793;method_61649(I)Lnet/minecraft/class_1792$class_1793;
      official c Lcxk$a;c(I)Lcxk$a;
    • repairable

      public Item.Settings repairable(Item repairIngredient)
      Mappings:
      Namespace Name Mixin selector
      named repairable Lnet/minecraft/item/Item$Settings;repairable(Lnet/minecraft/item/Item;)Lnet/minecraft/item/Item$Settings;
      intermediary method_61648 Lnet/minecraft/class_1792$class_1793;method_61648(Lnet/minecraft/class_1792;)Lnet/minecraft/class_1792$class_1793;
      official c Lcxk$a;c(Lcxk;)Lcxk$a;
    • repairable

      public Item.Settings repairable(TagKey<Item> repairIngredientsTag)
      Mappings:
      Namespace Name Mixin selector
      named repairable Lnet/minecraft/item/Item$Settings;repairable(Lnet/minecraft/registry/tag/TagKey;)Lnet/minecraft/item/Item$Settings;
      intermediary method_61647 Lnet/minecraft/class_1792$class_1793;method_61647(Lnet/minecraft/class_6862;)Lnet/minecraft/class_1792$class_1793;
      official a Lcxk$a;a(Layk;)Lcxk$a;
    • equippable

      public Item.Settings equippable(EquipmentSlot slot)
      Mappings:
      Namespace Name Mixin selector
      named equippable Lnet/minecraft/item/Item$Settings;equippable(Lnet/minecraft/entity/EquipmentSlot;)Lnet/minecraft/item/Item$Settings;
      intermediary method_63682 Lnet/minecraft/class_1792$class_1793;method_63682(Lnet/minecraft/class_1304;)Lnet/minecraft/class_1792$class_1793;
      official a Lcxk$a;a(Lbvr;)Lcxk$a;
    • equippableUnswappable

      public Item.Settings equippableUnswappable(EquipmentSlot slot)
      Mappings:
      Namespace Name Mixin selector
      named equippableUnswappable Lnet/minecraft/item/Item$Settings;equippableUnswappable(Lnet/minecraft/entity/EquipmentSlot;)Lnet/minecraft/item/Item$Settings;
      intermediary method_64194 Lnet/minecraft/class_1792$class_1793;method_64194(Lnet/minecraft/class_1304;)Lnet/minecraft/class_1792$class_1793;
      official b Lcxk$a;b(Lbvr;)Lcxk$a;
    • requires

      public Item.Settings requires(FeatureFlag[] features)
      Mappings:
      Namespace Name Mixin selector
      named requires Lnet/minecraft/item/Item$Settings;requires([Lnet/minecraft/resource/featuretoggle/FeatureFlag;)Lnet/minecraft/item/Item$Settings;
      intermediary method_45434 Lnet/minecraft/class_1792$class_1793;method_45434([Lnet/minecraft/class_7696;)Lnet/minecraft/class_1792$class_1793;
      official a Lcxk$a;a([Lcsq;)Lcxk$a;
    • registryKey

      public Item.Settings registryKey(RegistryKey<Item> registryKey)
      Mappings:
      Namespace Name Mixin selector
      named registryKey Lnet/minecraft/item/Item$Settings;registryKey(Lnet/minecraft/registry/RegistryKey;)Lnet/minecraft/item/Item$Settings;
      intermediary method_63686 Lnet/minecraft/class_1792$class_1793;method_63686(Lnet/minecraft/class_5321;)Lnet/minecraft/class_1792$class_1793;
      official b Lcxk$a;b(Laly;)Lcxk$a;
    • translationKey

      public Item.Settings translationKey(String translationKey)
      Mappings:
      Namespace Name Mixin selector
      named translationKey Lnet/minecraft/item/Item$Settings;translationKey(Ljava/lang/String;)Lnet/minecraft/item/Item$Settings;
      intermediary method_63684 Lnet/minecraft/class_1792$class_1793;method_63684(Ljava/lang/String;)Lnet/minecraft/class_1792$class_1793;
      official a Lcxk$a;a(Ljava/lang/String;)Lcxk$a;
    • useBlockPrefixedTranslationKey

      public Item.Settings useBlockPrefixedTranslationKey()
      Mappings:
      Namespace Name Mixin selector
      named useBlockPrefixedTranslationKey Lnet/minecraft/item/Item$Settings;useBlockPrefixedTranslationKey()Lnet/minecraft/item/Item$Settings;
      intermediary method_63685 Lnet/minecraft/class_1792$class_1793;method_63685()Lnet/minecraft/class_1792$class_1793;
      official b Lcxk$a;b()Lcxk$a;
    • useItemPrefixedTranslationKey

      public Item.Settings useItemPrefixedTranslationKey()
      Mappings:
      Namespace Name Mixin selector
      named useItemPrefixedTranslationKey Lnet/minecraft/item/Item$Settings;useItemPrefixedTranslationKey()Lnet/minecraft/item/Item$Settings;
      intermediary method_63687 Lnet/minecraft/class_1792$class_1793;method_63687()Lnet/minecraft/class_1792$class_1793;
      official c Lcxk$a;c()Lcxk$a;
    • getTranslationKey

      protected String getTranslationKey()
      Mappings:
      Namespace Name Mixin selector
      named getTranslationKey Lnet/minecraft/item/Item$Settings;getTranslationKey()Ljava/lang/String;
      intermediary method_63689 Lnet/minecraft/class_1792$class_1793;method_63689()Ljava/lang/String;
      official d Lcxk$a;d()Ljava/lang/String;
    • modelId

      public Item.Settings modelId(Identifier modelId)
      Mappings:
      Namespace Name Mixin selector
      named modelId Lnet/minecraft/item/Item$Settings;modelId(Lnet/minecraft/util/Identifier;)Lnet/minecraft/item/Item$Settings;
      intermediary method_63681 Lnet/minecraft/class_1792$class_1793;method_63681(Lnet/minecraft/class_2960;)Lnet/minecraft/class_1792$class_1793;
      official a Lcxk$a;a(Lalz;)Lcxk$a;
    • getModelId

      public Identifier getModelId()
      Mappings:
      Namespace Name Mixin selector
      named getModelId Lnet/minecraft/item/Item$Settings;getModelId()Lnet/minecraft/util/Identifier;
      intermediary method_63691 Lnet/minecraft/class_1792$class_1793;method_63691()Lnet/minecraft/class_2960;
      official e Lcxk$a;e()Lalz;
    • component

      public <T> Item.Settings component(ComponentType<T> type, T value)
      Mappings:
      Namespace Name Mixin selector
      named component Lnet/minecraft/item/Item$Settings;component(Lnet/minecraft/component/ComponentType;Ljava/lang/Object;)Lnet/minecraft/item/Item$Settings;
      intermediary method_57349 Lnet/minecraft/class_1792$class_1793;method_57349(Lnet/minecraft/class_9331;Ljava/lang/Object;)Lnet/minecraft/class_1792$class_1793;
      official a Lcxk$a;a(Lkt;Ljava/lang/Object;)Lcxk$a;
    • attributeModifiers

      public Item.Settings attributeModifiers(AttributeModifiersComponent attributeModifiersComponent)
      Mappings:
      Namespace Name Mixin selector
      named attributeModifiers Lnet/minecraft/item/Item$Settings;attributeModifiers(Lnet/minecraft/component/type/AttributeModifiersComponent;)Lnet/minecraft/item/Item$Settings;
      intermediary method_57348 Lnet/minecraft/class_1792$class_1793;method_57348(Lnet/minecraft/class_9285;)Lnet/minecraft/class_1792$class_1793;
      official a Lcxk$a;a(Ldaf;)Lcxk$a;
    • getValidatedComponents

      ComponentMap getValidatedComponents(Text name, Identifier modelId)
      Mappings:
      Namespace Name Mixin selector
      named getValidatedComponents Lnet/minecraft/item/Item$Settings;getValidatedComponents(Lnet/minecraft/text/Text;Lnet/minecraft/util/Identifier;)Lnet/minecraft/component/ComponentMap;
      intermediary method_58406 Lnet/minecraft/class_1792$class_1793;method_58406(Lnet/minecraft/class_2561;Lnet/minecraft/class_2960;)Lnet/minecraft/class_9323;
      official a Lcxk$a;a(Lxv;Lalz;)Lkq;