Package net.fabricmc.fabric.api.item.v1
Class FabricItemSettings
java.lang.Object
net.minecraft.item.Item.Settings
net.fabricmc.fabric.api.item.v1.FabricItemSettings
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptioncustomDamage
(CustomDamageHandler handler) Sets the custom damage handler of the item.equipmentSlot
(EquipmentSlotProvider equipmentSlotProvider) Sets the equipment slot provider of the item.food
(FoodComponent foodComponent) maxCount
(int maxCount) maxDamage
(int maxDamage) maxDamageIfAbsent
(int maxDamage) recipeRemainder
(Item recipeRemainder) Methods inherited from class net.minecraft.item.Item.Settings
requires
-
Constructor Details
-
FabricItemSettings
public FabricItemSettings()
-
-
Method Details
-
equipmentSlot
Sets the equipment slot provider of the item.- Parameters:
equipmentSlotProvider
- the equipment slot provider- Returns:
- this builder
-
customDamage
Sets the custom damage handler of the item. Note that this is only called on an ItemStack ifItemStack.isDamageable()
returns true.- See Also:
-
food
- Overrides:
food
in classItem.Settings
-
maxCount
- Overrides:
maxCount
in classItem.Settings
-
maxDamageIfAbsent
- Overrides:
maxDamageIfAbsent
in classItem.Settings
-
maxDamage
- Overrides:
maxDamage
in classItem.Settings
-
recipeRemainder
- Overrides:
recipeRemainder
in classItem.Settings
-
rarity
- Overrides:
rarity
in classItem.Settings
-
fireproof
- Overrides:
fireproof
in classItem.Settings
-