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 cre$aintermediary net/minecraft/class_1792$class_1793named net/minecraft/item/Item$Settings
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Interner<class_9323> private class_9323.class_9324(package private) boolean(package private) @Nullable FoodComponent(package private) int(package private) int(package private) Rarity(package private) FeatureSet -
Constructor Summary
Constructors -
Method Summary
Modifier 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).method_57348(class_9285 class_9285) <T> Item.Settingsmethod_57349(class_9331<T> class_9331, T t) (package private) class_9323Sets 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
-
field_49264
- Mappings:
Namespace Name Mixin selector official aLcre$a;a:Lcom/google/common/collect/Interner;intermediary field_49264Lnet/minecraft/class_1792$class_1793;field_49264:Lcom/google/common/collect/Interner;named field_49264Lnet/minecraft/item/Item$Settings;field_49264:Lcom/google/common/collect/Interner;
-
field_49265
- Mappings:
Namespace Name Mixin selector official bLcre$a;b:Ljl$a;intermediary field_49265Lnet/minecraft/class_1792$class_1793;field_49265:Lnet/minecraft/class_9323$class_9324;named field_49265Lnet/minecraft/item/Item$Settings;field_49265:Lnet/minecraft/class_9323$class_9324;
-
maxCount
int maxCount- Mappings:
Namespace Name Mixin selector official cLcre$a;c:Iintermediary field_8020Lnet/minecraft/class_1792$class_1793;field_8020:Inamed maxCountLnet/minecraft/item/Item$Settings;maxCount:I
-
maxDamage
int maxDamage- Mappings:
Namespace Name Mixin selector official dLcre$a;d:Iintermediary field_8019Lnet/minecraft/class_1792$class_1793;field_8019:Inamed maxDamageLnet/minecraft/item/Item$Settings;maxDamage:I
-
recipeRemainder
- Mappings:
Namespace Name Mixin selector official eLcre$a;e:Lcre;intermediary field_8018Lnet/minecraft/class_1792$class_1793;field_8018:Lnet/minecraft/class_1792;named recipeRemainderLnet/minecraft/item/Item$Settings;recipeRemainder:Lnet/minecraft/item/Item;
-
rarity
Rarity rarity- Mappings:
Namespace Name Mixin selector official fLcre$a;f:Lcsa;intermediary field_8016Lnet/minecraft/class_1792$class_1793;field_8016:Lnet/minecraft/class_1814;named rarityLnet/minecraft/item/Item$Settings;rarity:Lnet/minecraft/util/Rarity;
-
foodComponent
- Mappings:
Namespace Name Mixin selector official gLcre$a;g:Lcmm;intermediary field_18673Lnet/minecraft/class_1792$class_1793;field_18673:Lnet/minecraft/class_4174;named foodComponentLnet/minecraft/item/Item$Settings;foodComponent:Lnet/minecraft/item/FoodComponent;
-
fireproof
boolean fireproof- Mappings:
Namespace Name Mixin selector official hLcre$a;h:Zintermediary field_21980Lnet/minecraft/class_1792$class_1793;field_21980:Znamed fireproofLnet/minecraft/item/Item$Settings;fireproof:Z
-
requiredFeatures
FeatureSet requiredFeatures- Mappings:
Namespace Name Mixin selector official iLcre$a;i:Lcmg;intermediary field_40210Lnet/minecraft/class_1792$class_1793;field_40210:Lnet/minecraft/class_7699;named requiredFeaturesLnet/minecraft/item/Item$Settings;requiredFeatures:Lnet/minecraft/resource/featuretoggle/FeatureSet;
-
-
Constructor Details
-
Settings
public Settings()
-
-
Method Details
-
food
When 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 aLcre$a;a(Lcmm;)Lcre$a;intermediary method_19265Lnet/minecraft/class_1792$class_1793;method_19265(Lnet/minecraft/class_4174;)Lnet/minecraft/class_1792$class_1793;named foodLnet/minecraft/item/Item$Settings;food(Lnet/minecraft/item/FoodComponent;)Lnet/minecraft/item/Item$Settings;
-
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 official aLcre$a;a(I)Lcre$a;intermediary method_7889Lnet/minecraft/class_1792$class_1793;method_7889(I)Lnet/minecraft/class_1792$class_1793;named maxCountLnet/minecraft/item/Item$Settings;maxCount(I)Lnet/minecraft/item/Item$Settings;
-
maxDamageIfAbsent
CallsmaxDamageIf 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 bLcre$a;b(I)Lcre$a;intermediary method_7898Lnet/minecraft/class_1792$class_1793;method_7898(I)Lnet/minecraft/class_1792$class_1793;named maxDamageIfAbsentLnet/minecraft/item/Item$Settings;maxDamageIfAbsent(I)Lnet/minecraft/item/Item$Settings;
-
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 official cLcre$a;c(I)Lcre$a;intermediary method_7895Lnet/minecraft/class_1792$class_1793;method_7895(I)Lnet/minecraft/class_1792$class_1793;named maxDamageLnet/minecraft/item/Item$Settings;maxDamage(I)Lnet/minecraft/item/Item$Settings;
-
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 official aLcre$a;a(Lcre;)Lcre$a;intermediary method_7896Lnet/minecraft/class_1792$class_1793;method_7896(Lnet/minecraft/class_1792;)Lnet/minecraft/class_1792$class_1793;named recipeRemainderLnet/minecraft/item/Item$Settings;recipeRemainder(Lnet/minecraft/item/Item;)Lnet/minecraft/item/Item$Settings;
-
rarity
Sets 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 aLcre$a;a(Lcsa;)Lcre$a;intermediary method_7894Lnet/minecraft/class_1792$class_1793;method_7894(Lnet/minecraft/class_1814;)Lnet/minecraft/class_1792$class_1793;named rarityLnet/minecraft/item/Item$Settings;rarity(Lnet/minecraft/util/Rarity;)Lnet/minecraft/item/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 official aLcre$a;a()Lcre$a;intermediary method_24359Lnet/minecraft/class_1792$class_1793;method_24359()Lnet/minecraft/class_1792$class_1793;named fireproofLnet/minecraft/item/Item$Settings;fireproof()Lnet/minecraft/item/Item$Settings;
-
requires
- Mappings:
Namespace Name Mixin selector official aLcre$a;a([Lcme;)Lcre$a;intermediary method_45434Lnet/minecraft/class_1792$class_1793;method_45434([Lnet/minecraft/class_7696;)Lnet/minecraft/class_1792$class_1793;named requiresLnet/minecraft/item/Item$Settings;requires([Lnet/minecraft/resource/featuretoggle/FeatureFlag;)Lnet/minecraft/item/Item$Settings;
-
method_57349
- Mappings:
Namespace Name Mixin selector official aLcre$a;a(Ljo;Ljava/lang/Object;)Lcre$a;intermediary method_57349Lnet/minecraft/class_1792$class_1793;method_57349(Lnet/minecraft/class_9331;Ljava/lang/Object;)Lnet/minecraft/class_1792$class_1793;named method_57349Lnet/minecraft/item/Item$Settings;method_57349(Lnet/minecraft/class_9331;Ljava/lang/Object;)Lnet/minecraft/item/Item$Settings;
-
method_57348
- Mappings:
Namespace Name Mixin selector official aLcre$a;a(Lctz;)Lcre$a;intermediary method_57348Lnet/minecraft/class_1792$class_1793;method_57348(Lnet/minecraft/class_9285;)Lnet/minecraft/class_1792$class_1793;named method_57348Lnet/minecraft/item/Item$Settings;method_57348(Lnet/minecraft/class_9285;)Lnet/minecraft/item/Item$Settings;
-
method_57350
class_9323 method_57350()- Mappings:
Namespace Name Mixin selector official bLcre$a;b()Ljl;intermediary method_57350Lnet/minecraft/class_1792$class_1793;method_57350()Lnet/minecraft/class_9323;named method_57350Lnet/minecraft/item/Item$Settings;method_57350()Lnet/minecraft/class_9323;
-