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
Constructors -
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) requires(FeatureFlag... features)
-
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:
foodin classItem.Settings
-
maxCount
- Overrides:
maxCountin classItem.Settings
-
maxDamageIfAbsent
- Overrides:
maxDamageIfAbsentin classItem.Settings
-
maxDamage
- Overrides:
maxDamagein classItem.Settings
-
recipeRemainder
- Overrides:
recipeRemainderin classItem.Settings
-
rarity
- Overrides:
rarityin classItem.Settings
-
fireproof
- Overrides:
fireproofin classItem.Settings
-
requires
- Overrides:
requiresin classItem.Settings
-