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 named net/minecraft/item/Item$Settingsintermediary net/minecraft/class_1792$class_1793official cyo$a
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final RegistryKeyedValue<Item, String> private final ComponentMap.Builderprivate static final RegistryKeyedValue<Item, String> private RegistryKeyedValue<Item, Identifier> private @Nullable RegistryKey<Item> (package private) FeatureSetprivate RegistryKeyedValue<Item, String> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionarmor(ArmorMaterial material, EquipmentType type) attributeModifiers(AttributeModifiersComponent attributeModifiersComponent) <T> Item.Settingscomponent(ComponentType<T> type, T value) enchantable(int enchantability) equippable(EquipmentSlot slot) If 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.food(FoodComponent foodComponent, ConsumableComponent consumableComponent) protected String(package private) ComponentMapgetValidatedComponents(Text name, Identifier modelId) jukeboxPlayable(RegistryKey<JukeboxSong> songKey) 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.method_67188(ArmorMaterial armorMaterial) method_67189(RegistryKey<ArmorTrimMaterial> registryKey) method_67190(ToolMaterial toolMaterial, float float2, float float3) method_67191(ArmorMaterial armorMaterial) method_67192(ToolMaterial toolMaterial, float float2, float float3) method_67193(ToolMaterial toolMaterial, float float2, float float3) pickaxe(ToolMaterial material, float attackDamage, float attackSpeed) 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.registryKey(RegistryKey<Item> registryKey) repairable(Item repairIngredient) repairable(TagKey<Item> repairIngredientsTag) requires(FeatureFlag[] features) sword(ToolMaterial material, float attackDamage, float attackSpeed) tool(ToolMaterial material, TagKey<Block> effectiveBlocks, float attackDamage, float attackSpeed, float float2) translationKey(String translationKey) useCooldown(float seconds) useRemainder(Item convertInto)
-
Field Details
-
BLOCK_PREFIXED_TRANSLATION_KEY
- Mappings:
Namespace Name Mixin selector named BLOCK_PREFIXED_TRANSLATION_KEYLnet/minecraft/item/Item$Settings;BLOCK_PREFIXED_TRANSLATION_KEY:Lnet/minecraft/registry/RegistryKeyedValue;intermediary field_54115Lnet/minecraft/class_1792$class_1793;field_54115:Lnet/minecraft/class_10162;official aLcyo$a;a:Lakw;
-
ITEM_PREFIXED_TRANSLATION_KEY
- Mappings:
Namespace Name Mixin selector named ITEM_PREFIXED_TRANSLATION_KEYLnet/minecraft/item/Item$Settings;ITEM_PREFIXED_TRANSLATION_KEY:Lnet/minecraft/registry/RegistryKeyedValue;intermediary field_54116Lnet/minecraft/class_1792$class_1793;field_54116:Lnet/minecraft/class_10162;official bLcyo$a;b:Lakw;
-
components
- Mappings:
Namespace Name Mixin selector named componentsLnet/minecraft/item/Item$Settings;components:Lnet/minecraft/component/ComponentMap$Builder;intermediary field_49265Lnet/minecraft/class_1792$class_1793;field_49265:Lnet/minecraft/class_9323$class_9324;official cLcyo$a;c:Lkg$a;
-
recipeRemainder
- Mappings:
Namespace Name Mixin selector named recipeRemainderLnet/minecraft/item/Item$Settings;recipeRemainder:Lnet/minecraft/item/Item;intermediary field_8018Lnet/minecraft/class_1792$class_1793;field_8018:Lnet/minecraft/class_1792;official dLcyo$a;d:Lcyo;
-
requiredFeatures
FeatureSet requiredFeatures- Mappings:
Namespace Name Mixin selector named requiredFeaturesLnet/minecraft/item/Item$Settings;requiredFeatures:Lnet/minecraft/resource/featuretoggle/FeatureSet;intermediary field_40210Lnet/minecraft/class_1792$class_1793;field_40210:Lnet/minecraft/class_7699;official eLcyo$a;e:Lcub;
-
registryKey
- Mappings:
Namespace Name Mixin selector named registryKeyLnet/minecraft/item/Item$Settings;registryKey:Lnet/minecraft/registry/RegistryKey;intermediary field_54117Lnet/minecraft/class_1792$class_1793;field_54117:Lnet/minecraft/class_5321;official fLcyo$a;f:Lald;
-
translationKey
- Mappings:
Namespace Name Mixin selector named translationKeyLnet/minecraft/item/Item$Settings;translationKey:Lnet/minecraft/registry/RegistryKeyedValue;intermediary field_54118Lnet/minecraft/class_1792$class_1793;field_54118:Lnet/minecraft/class_10162;official gLcyo$a;g:Lakw;
-
modelId
- Mappings:
Namespace Name Mixin selector named modelIdLnet/minecraft/item/Item$Settings;modelId:Lnet/minecraft/registry/RegistryKeyedValue;intermediary field_54119Lnet/minecraft/class_1792$class_1793;field_54119:Lnet/minecraft/class_10162;official hLcyo$a;h:Lakw;
-
-
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 named foodLnet/minecraft/item/Item$Settings;food(Lnet/minecraft/component/type/FoodComponent;)Lnet/minecraft/item/Item$Settings;intermediary method_19265Lnet/minecraft/class_1792$class_1793;method_19265(Lnet/minecraft/class_4174;)Lnet/minecraft/class_1792$class_1793;official aLcyo$a;a(Lcuh;)Lcyo$a;
-
food
- Mappings:
Namespace Name Mixin selector named foodLnet/minecraft/item/Item$Settings;food(Lnet/minecraft/component/type/FoodComponent;Lnet/minecraft/component/type/ConsumableComponent;)Lnet/minecraft/item/Item$Settings;intermediary method_62833Lnet/minecraft/class_1792$class_1793;method_62833(Lnet/minecraft/class_4174;Lnet/minecraft/class_10124;)Lnet/minecraft/class_1792$class_1793;official aLcyo$a;a(Lcuh;Ldax;)Lcyo$a;
-
useRemainder
- Mappings:
Namespace Name Mixin selector named useRemainderLnet/minecraft/item/Item$Settings;useRemainder(Lnet/minecraft/item/Item;)Lnet/minecraft/item/Item$Settings;intermediary method_62834Lnet/minecraft/class_1792$class_1793;method_62834(Lnet/minecraft/class_1792;)Lnet/minecraft/class_1792$class_1793;official aLcyo$a;a(Lcyo;)Lcyo$a;
-
useCooldown
- Mappings:
Namespace Name Mixin selector named useCooldownLnet/minecraft/item/Item$Settings;useCooldown(F)Lnet/minecraft/item/Item$Settings;intermediary method_62832Lnet/minecraft/class_1792$class_1793;method_62832(F)Lnet/minecraft/class_1792$class_1793;official aLcyo$a;a(F)Lcyo$a;
-
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 maxCountLnet/minecraft/item/Item$Settings;maxCount(I)Lnet/minecraft/item/Item$Settings;intermediary method_7889Lnet/minecraft/class_1792$class_1793;method_7889(I)Lnet/minecraft/class_1792$class_1793;official aLcyo$a;a(I)Lcyo$a;
-
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 maxDamageLnet/minecraft/item/Item$Settings;maxDamage(I)Lnet/minecraft/item/Item$Settings;intermediary method_7895Lnet/minecraft/class_1792$class_1793;method_7895(I)Lnet/minecraft/class_1792$class_1793;official bLcyo$a;b(I)Lcyo$a;
-
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 recipeRemainderLnet/minecraft/item/Item$Settings;recipeRemainder(Lnet/minecraft/item/Item;)Lnet/minecraft/item/Item$Settings;intermediary method_7896Lnet/minecraft/class_1792$class_1793;method_7896(Lnet/minecraft/class_1792;)Lnet/minecraft/class_1792$class_1793;official bLcyo$a;b(Lcyo;)Lcyo$a;
-
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 named rarityLnet/minecraft/item/Item$Settings;rarity(Lnet/minecraft/util/Rarity;)Lnet/minecraft/item/Item$Settings;intermediary method_7894Lnet/minecraft/class_1792$class_1793;method_7894(Lnet/minecraft/class_1814;)Lnet/minecraft/class_1792$class_1793;official aLcyo$a;a(Lczo;)Lcyo$a;
-
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 fireproofLnet/minecraft/item/Item$Settings;fireproof()Lnet/minecraft/item/Item$Settings;intermediary method_24359Lnet/minecraft/class_1792$class_1793;method_24359()Lnet/minecraft/class_1792$class_1793;official aLcyo$a;a()Lcyo$a;
-
jukeboxPlayable
- Mappings:
Namespace Name Mixin selector named jukeboxPlayableLnet/minecraft/item/Item$Settings;jukeboxPlayable(Lnet/minecraft/registry/RegistryKey;)Lnet/minecraft/item/Item$Settings;intermediary method_60745Lnet/minecraft/class_1792$class_1793;method_60745(Lnet/minecraft/class_5321;)Lnet/minecraft/class_1792$class_1793;official aLcyo$a;a(Lald;)Lcyo$a;
-
enchantable
- Mappings:
Namespace Name Mixin selector named enchantableLnet/minecraft/item/Item$Settings;enchantable(I)Lnet/minecraft/item/Item$Settings;intermediary method_61649Lnet/minecraft/class_1792$class_1793;method_61649(I)Lnet/minecraft/class_1792$class_1793;official cLcyo$a;c(I)Lcyo$a;
-
repairable
- Mappings:
Namespace Name Mixin selector named repairableLnet/minecraft/item/Item$Settings;repairable(Lnet/minecraft/item/Item;)Lnet/minecraft/item/Item$Settings;intermediary method_61648Lnet/minecraft/class_1792$class_1793;method_61648(Lnet/minecraft/class_1792;)Lnet/minecraft/class_1792$class_1793;official cLcyo$a;c(Lcyo;)Lcyo$a;
-
repairable
- Mappings:
Namespace Name Mixin selector named repairableLnet/minecraft/item/Item$Settings;repairable(Lnet/minecraft/registry/tag/TagKey;)Lnet/minecraft/item/Item$Settings;intermediary method_61647Lnet/minecraft/class_1792$class_1793;method_61647(Lnet/minecraft/class_6862;)Lnet/minecraft/class_1792$class_1793;official aLcyo$a;a(Laxp;)Lcyo$a;
-
equippable
- Mappings:
Namespace Name Mixin selector named equippableLnet/minecraft/item/Item$Settings;equippable(Lnet/minecraft/entity/EquipmentSlot;)Lnet/minecraft/item/Item$Settings;intermediary method_63682Lnet/minecraft/class_1792$class_1793;method_63682(Lnet/minecraft/class_1304;)Lnet/minecraft/class_1792$class_1793;official aLcyo$a;a(Lbwk;)Lcyo$a;
-
equippableUnswappable
- Mappings:
Namespace Name Mixin selector named equippableUnswappableLnet/minecraft/item/Item$Settings;equippableUnswappable(Lnet/minecraft/entity/EquipmentSlot;)Lnet/minecraft/item/Item$Settings;intermediary method_64194Lnet/minecraft/class_1792$class_1793;method_64194(Lnet/minecraft/class_1304;)Lnet/minecraft/class_1792$class_1793;official bLcyo$a;b(Lbwk;)Lcyo$a;
-
tool
public Item.Settings tool(ToolMaterial material, TagKey<Block> effectiveBlocks, float attackDamage, float attackSpeed, float float2) - Mappings:
Namespace Name Mixin selector named toolLnet/minecraft/item/Item$Settings;tool(Lnet/minecraft/item/ToolMaterial;Lnet/minecraft/registry/tag/TagKey;FFF)Lnet/minecraft/item/Item$Settings;intermediary method_66331Lnet/minecraft/class_1792$class_1793;method_66331(Lnet/minecraft/class_9886;Lnet/minecraft/class_6862;FFF)Lnet/minecraft/class_1792$class_1793;official aLcyo$a;a(Ldag;Laxp;FFF)Lcyo$a;
-
pickaxe
- Mappings:
Namespace Name Mixin selector named pickaxeLnet/minecraft/item/Item$Settings;pickaxe(Lnet/minecraft/item/ToolMaterial;FF)Lnet/minecraft/item/Item$Settings;intermediary method_66330Lnet/minecraft/class_1792$class_1793;method_66330(Lnet/minecraft/class_9886;FF)Lnet/minecraft/class_1792$class_1793;official aLcyo$a;a(Ldag;FF)Lcyo$a;
-
method_67190
- Mappings:
Namespace Name Mixin selector named method_67190Lnet/minecraft/item/Item$Settings;method_67190(Lnet/minecraft/item/ToolMaterial;FF)Lnet/minecraft/item/Item$Settings;intermediary method_67190Lnet/minecraft/class_1792$class_1793;method_67190(Lnet/minecraft/class_9886;FF)Lnet/minecraft/class_1792$class_1793;official bLcyo$a;b(Ldag;FF)Lcyo$a;
-
method_67192
- Mappings:
Namespace Name Mixin selector named method_67192Lnet/minecraft/item/Item$Settings;method_67192(Lnet/minecraft/item/ToolMaterial;FF)Lnet/minecraft/item/Item$Settings;intermediary method_67192Lnet/minecraft/class_1792$class_1793;method_67192(Lnet/minecraft/class_9886;FF)Lnet/minecraft/class_1792$class_1793;official cLcyo$a;c(Ldag;FF)Lcyo$a;
-
method_67193
- Mappings:
Namespace Name Mixin selector named method_67193Lnet/minecraft/item/Item$Settings;method_67193(Lnet/minecraft/item/ToolMaterial;FF)Lnet/minecraft/item/Item$Settings;intermediary method_67193Lnet/minecraft/class_1792$class_1793;method_67193(Lnet/minecraft/class_9886;FF)Lnet/minecraft/class_1792$class_1793;official dLcyo$a;d(Ldag;FF)Lcyo$a;
-
sword
- Mappings:
Namespace Name Mixin selector named swordLnet/minecraft/item/Item$Settings;sword(Lnet/minecraft/item/ToolMaterial;FF)Lnet/minecraft/item/Item$Settings;intermediary method_66333Lnet/minecraft/class_1792$class_1793;method_66333(Lnet/minecraft/class_9886;FF)Lnet/minecraft/class_1792$class_1793;official eLcyo$a;e(Ldag;FF)Lcyo$a;
-
armor
- Mappings:
Namespace Name Mixin selector named armorLnet/minecraft/item/Item$Settings;armor(Lnet/minecraft/item/equipment/ArmorMaterial;Lnet/minecraft/item/equipment/EquipmentType;)Lnet/minecraft/item/Item$Settings;intermediary method_66332Lnet/minecraft/class_1792$class_1793;method_66332(Lnet/minecraft/class_1741;Lnet/minecraft/class_8051;)Lnet/minecraft/class_1792$class_1793;official aLcyo$a;a(Ldgw;Ldgy;)Lcyo$a;
-
method_67188
- Mappings:
Namespace Name Mixin selector named method_67188Lnet/minecraft/item/Item$Settings;method_67188(Lnet/minecraft/item/equipment/ArmorMaterial;)Lnet/minecraft/item/Item$Settings;intermediary method_67188Lnet/minecraft/class_1792$class_1793;method_67188(Lnet/minecraft/class_1741;)Lnet/minecraft/class_1792$class_1793;official aLcyo$a;a(Ldgw;)Lcyo$a;
-
method_67191
- Mappings:
Namespace Name Mixin selector named method_67191Lnet/minecraft/item/Item$Settings;method_67191(Lnet/minecraft/item/equipment/ArmorMaterial;)Lnet/minecraft/item/Item$Settings;intermediary method_67191Lnet/minecraft/class_1792$class_1793;method_67191(Lnet/minecraft/class_1741;)Lnet/minecraft/class_1792$class_1793;official bLcyo$a;b(Ldgw;)Lcyo$a;
-
method_67189
- Mappings:
Namespace Name Mixin selector named method_67189Lnet/minecraft/item/Item$Settings;method_67189(Lnet/minecraft/registry/RegistryKey;)Lnet/minecraft/item/Item$Settings;intermediary method_67189Lnet/minecraft/class_1792$class_1793;method_67189(Lnet/minecraft/class_5321;)Lnet/minecraft/class_1792$class_1793;official bLcyo$a;b(Lald;)Lcyo$a;
-
requires
- Mappings:
Namespace Name Mixin selector named requiresLnet/minecraft/item/Item$Settings;requires([Lnet/minecraft/resource/featuretoggle/FeatureFlag;)Lnet/minecraft/item/Item$Settings;intermediary method_45434Lnet/minecraft/class_1792$class_1793;method_45434([Lnet/minecraft/class_7696;)Lnet/minecraft/class_1792$class_1793;official aLcyo$a;a([Lctz;)Lcyo$a;
-
registryKey
- Mappings:
Namespace Name Mixin selector named registryKeyLnet/minecraft/item/Item$Settings;registryKey(Lnet/minecraft/registry/RegistryKey;)Lnet/minecraft/item/Item$Settings;intermediary method_63686Lnet/minecraft/class_1792$class_1793;method_63686(Lnet/minecraft/class_5321;)Lnet/minecraft/class_1792$class_1793;official cLcyo$a;c(Lald;)Lcyo$a;
-
translationKey
- Mappings:
Namespace Name Mixin selector named translationKeyLnet/minecraft/item/Item$Settings;translationKey(Ljava/lang/String;)Lnet/minecraft/item/Item$Settings;intermediary method_63684Lnet/minecraft/class_1792$class_1793;method_63684(Ljava/lang/String;)Lnet/minecraft/class_1792$class_1793;official aLcyo$a;a(Ljava/lang/String;)Lcyo$a;
-
useBlockPrefixedTranslationKey
- Mappings:
Namespace Name Mixin selector named useBlockPrefixedTranslationKeyLnet/minecraft/item/Item$Settings;useBlockPrefixedTranslationKey()Lnet/minecraft/item/Item$Settings;intermediary method_63685Lnet/minecraft/class_1792$class_1793;method_63685()Lnet/minecraft/class_1792$class_1793;official bLcyo$a;b()Lcyo$a;
-
useItemPrefixedTranslationKey
- Mappings:
Namespace Name Mixin selector named useItemPrefixedTranslationKeyLnet/minecraft/item/Item$Settings;useItemPrefixedTranslationKey()Lnet/minecraft/item/Item$Settings;intermediary method_63687Lnet/minecraft/class_1792$class_1793;method_63687()Lnet/minecraft/class_1792$class_1793;official cLcyo$a;c()Lcyo$a;
-
getTranslationKey
- Mappings:
Namespace Name Mixin selector named getTranslationKeyLnet/minecraft/item/Item$Settings;getTranslationKey()Ljava/lang/String;intermediary method_63689Lnet/minecraft/class_1792$class_1793;method_63689()Ljava/lang/String;official dLcyo$a;d()Ljava/lang/String;
-
getModelId
- Mappings:
Namespace Name Mixin selector named getModelIdLnet/minecraft/item/Item$Settings;getModelId()Lnet/minecraft/util/Identifier;intermediary method_63691Lnet/minecraft/class_1792$class_1793;method_63691()Lnet/minecraft/class_2960;official eLcyo$a;e()Lale;
-
component
- Mappings:
Namespace Name Mixin selector named componentLnet/minecraft/item/Item$Settings;component(Lnet/minecraft/component/ComponentType;Ljava/lang/Object;)Lnet/minecraft/item/Item$Settings;intermediary method_57349Lnet/minecraft/class_1792$class_1793;method_57349(Lnet/minecraft/class_9331;Ljava/lang/Object;)Lnet/minecraft/class_1792$class_1793;official aLcyo$a;a(Lki;Ljava/lang/Object;)Lcyo$a;
-
attributeModifiers
- Mappings:
Namespace Name Mixin selector named attributeModifiersLnet/minecraft/item/Item$Settings;attributeModifiers(Lnet/minecraft/component/type/AttributeModifiersComponent;)Lnet/minecraft/item/Item$Settings;intermediary method_57348Lnet/minecraft/class_1792$class_1793;method_57348(Lnet/minecraft/class_9285;)Lnet/minecraft/class_1792$class_1793;official aLcyo$a;a(Ldbj;)Lcyo$a;
-
getValidatedComponents
- Mappings:
Namespace Name Mixin selector named getValidatedComponentsLnet/minecraft/item/Item$Settings;getValidatedComponents(Lnet/minecraft/text/Text;Lnet/minecraft/util/Identifier;)Lnet/minecraft/component/ComponentMap;intermediary method_58406Lnet/minecraft/class_1792$class_1793;method_58406(Lnet/minecraft/class_2561;Lnet/minecraft/class_2960;)Lnet/minecraft/class_9323;official aLcyo$a;a(Lww;Lale;)Lkg;
-