Package net.minecraft.item
Class Item.Settings
java.lang.Object
net.minecraft.item.Item.Settings
- Enclosing class:
- Item
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 - official - cfu$a- intermediary - net/minecraft/class_1792$class_1793- named - net/minecraft/item/Item$Settings
- 
Field SummaryFieldsModifier and TypeFieldDescription(package private) boolean(package private) @Nullable FoodComponent(package private) int(package private) int(package private) Rarity(package private) FeatureSet
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionIf called, any item with this Settings instance is immune to fire and lava damage.food(FoodComponent foodComponent) When set, any item configured with this Settings instance will be edible based on the providedFoodComponent.maxCount(int maxCount) Sets the maximum stack count of any ItemStack with an Item using this Settings instance.maxDamage(int maxDamage) Sets the maximum durability of any item configured with this Settings instance.maxDamageIfAbsent(int maxDamage) CallsmaxDamageIf this Settings instance has not already set max damage (or if max damage is the default value, 0).Sets theRarityof any item configured with this Settings instance, which changes the color of its name.recipeRemainder(Item recipeRemainder) Sets the recipe remainder for any item configured with this Settings instance.requires(FeatureFlag[] features) 
- 
Field Details- 
maxCountint maxCount- Mappings:
- Namespace - Name - Mixin selector - official - a- Lcfu$a;a:I- intermediary - field_8020- Lnet/minecraft/class_1792$class_1793;field_8020:I- named - maxCount- Lnet/minecraft/item/Item$Settings;maxCount:I
 
- 
maxDamageint maxDamage- Mappings:
- Namespace - Name - Mixin selector - official - b- Lcfu$a;b:I- intermediary - field_8019- Lnet/minecraft/class_1792$class_1793;field_8019:I- named - maxDamage- Lnet/minecraft/item/Item$Settings;maxDamage:I
 
- 
recipeRemainder- Mappings:
- Namespace - Name - Mixin selector - official - c- Lcfu$a;c:Lcfu;- intermediary - field_8018- Lnet/minecraft/class_1792$class_1793;field_8018:Lnet/minecraft/class_1792;- named - recipeRemainder- Lnet/minecraft/item/Item$Settings;recipeRemainder:Lnet/minecraft/item/Item;
 
- 
rarityRarity rarity- Mappings:
- Namespace - Name - Mixin selector - official - d- Lcfu$a;d:Lcgq;- intermediary - field_8016- Lnet/minecraft/class_1792$class_1793;field_8016:Lnet/minecraft/class_1814;- named - rarity- Lnet/minecraft/item/Item$Settings;rarity:Lnet/minecraft/util/Rarity;
 
- 
foodComponent- Mappings:
- Namespace - Name - Mixin selector - official - e- Lcfu$a;e:Lcbc;- intermediary - field_18673- Lnet/minecraft/class_1792$class_1793;field_18673:Lnet/minecraft/class_4174;- named - foodComponent- Lnet/minecraft/item/Item$Settings;foodComponent:Lnet/minecraft/item/FoodComponent;
 
- 
fireproofboolean fireproof- Mappings:
- Namespace - Name - Mixin selector - official - f- Lcfu$a;f:Z- intermediary - field_21980- Lnet/minecraft/class_1792$class_1793;field_21980:Z- named - fireproof- Lnet/minecraft/item/Item$Settings;fireproof:Z
 
- 
requiredFeaturesFeatureSet requiredFeatures- Mappings:
- Namespace - Name - Mixin selector - official - g- Lcfu$a;g:Lcaw;- intermediary - field_40210- Lnet/minecraft/class_1792$class_1793;field_40210:Lnet/minecraft/class_7699;- named - requiredFeatures- Lnet/minecraft/item/Item$Settings;requiredFeatures:Lnet/minecraft/resource/featuretoggle/FeatureSet;
 
 
- 
- 
Constructor Details- 
Settingspublic Settings()
 
- 
- 
Method Details- 
foodWhen set, any item configured with this Settings instance will be edible based on the providedFoodComponent.- Parameters:
- foodComponent- configured food properties for any item using this Settings instance
- Returns:
- this instance
- Mappings:
- Namespace - Name - Mixin selector - official - a- Lcfu$a;a(Lcbc;)Lcfu$a;- intermediary - method_19265- Lnet/minecraft/class_1792$class_1793;method_19265(Lnet/minecraft/class_4174;)Lnet/minecraft/class_1792$class_1793;- named - food- Lnet/minecraft/item/Item$Settings;food(Lnet/minecraft/item/FoodComponent;)Lnet/minecraft/item/Item$Settings;
 
- 
maxCountSets 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 - official - a- Lcfu$a;a(I)Lcfu$a;- intermediary - method_7889- Lnet/minecraft/class_1792$class_1793;method_7889(I)Lnet/minecraft/class_1792$class_1793;- named - maxCount- Lnet/minecraft/item/Item$Settings;maxCount(I)Lnet/minecraft/item/Item$Settings;
 
- 
maxDamageIfAbsentCallsmaxDamageIf this Settings instance has not already set max damage (or if max damage is the default value, 0).Note that max stack count is set to 1 when maxDamage 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 - official - b- Lcfu$a;b(I)Lcfu$a;- intermediary - method_7898- Lnet/minecraft/class_1792$class_1793;method_7898(I)Lnet/minecraft/class_1792$class_1793;- named - maxDamageIfAbsent- Lnet/minecraft/item/Item$Settings;maxDamageIfAbsent(I)Lnet/minecraft/item/Item$Settings;
 
- 
maxDamageSets 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 - official - c- Lcfu$a;c(I)Lcfu$a;- intermediary - method_7895- Lnet/minecraft/class_1792$class_1793;method_7895(I)Lnet/minecraft/class_1792$class_1793;- named - maxDamage- Lnet/minecraft/item/Item$Settings;maxDamage(I)Lnet/minecraft/item/Item$Settings;
 
- 
recipeRemainderSets 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 - official - a- Lcfu$a;a(Lcfu;)Lcfu$a;- intermediary - method_7896- Lnet/minecraft/class_1792$class_1793;method_7896(Lnet/minecraft/class_1792;)Lnet/minecraft/class_1792$class_1793;- named - recipeRemainder- Lnet/minecraft/item/Item$Settings;recipeRemainder(Lnet/minecraft/item/Item;)Lnet/minecraft/item/Item$Settings;
 
- 
raritySets theRarityof 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 - official - a- Lcfu$a;a(Lcgq;)Lcfu$a;- intermediary - method_7894- Lnet/minecraft/class_1792$class_1793;method_7894(Lnet/minecraft/class_1814;)Lnet/minecraft/class_1792$class_1793;- named - rarity- Lnet/minecraft/item/Item$Settings;rarity(Lnet/minecraft/util/Rarity;)Lnet/minecraft/item/Item$Settings;
 
- 
fireproofIf called, any item with this Settings instance is immune to fire and lava damage.- Returns:
- this instance
- Mappings:
- Namespace - Name - Mixin selector - official - a- Lcfu$a;a()Lcfu$a;- intermediary - method_24359- Lnet/minecraft/class_1792$class_1793;method_24359()Lnet/minecraft/class_1792$class_1793;- named - fireproof- Lnet/minecraft/item/Item$Settings;fireproof()Lnet/minecraft/item/Item$Settings;
 
- 
requires- Mappings:
- Namespace - Name - Mixin selector - official - a- Lcfu$a;a([Lcau;)Lcfu$a;- intermediary - method_45434- Lnet/minecraft/class_1792$class_1793;method_45434([Lnet/minecraft/class_7696;)Lnet/minecraft/class_1792$class_1793;- named - requires- Lnet/minecraft/item/Item$Settings;requires([Lnet/minecraft/resource/featuretoggle/FeatureFlag;)Lnet/minecraft/item/Item$Settings;
 
 
-