Package net.minecraft.item
Class ToolItem
java.lang.Object
net.minecraft.item.Item
net.minecraft.item.ToolItem
- All Implemented Interfaces:
ItemConvertible
- Direct Known Subclasses:
MiningToolItem
,SwordItem
public class ToolItem extends Item
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.item.Item
Item.Settings
-
Field Summary
Fields Modifier and Type Field Description private ToolMaterial
material
Fields inherited from class net.minecraft.item.Item
ATTACK_DAMAGE_MODIFIER_ID, ATTACK_SPEED_MODIFIER_ID, BLOCK_ITEMS, group, RANDOM
-
Constructor Summary
Constructors Constructor Description ToolItem(ToolMaterial material, Item.Settings settings)
-
Method Summary
Modifier and Type Method Description boolean
canRepair(ItemStack stack, ItemStack ingredient)
int
getEnchantability()
Gets the enchantability of an item.ToolMaterial
getMaterial()
Methods inherited from class net.minecraft.item.Item
appendStacks, appendTooltip, asItem, byRawId, canMine, damage, finishUsing, fromBlock, getAttributeModifiers, getDefaultStack, getDrinkSound, getEatSound, getFoodComponent, getGroup, getMaxCount, getMaxDamage, getMaxUseTime, getMiningSpeedMultiplier, getName, getName, getOrCreateTranslationKey, getRarity, getRawId, getRecipeRemainder, getTranslationKey, getTranslationKey, getUseAction, hasGlint, hasRecipeRemainder, inventoryTick, isDamageable, isEffectiveOn, isEnchantable, isFireproof, isFood, isIn, isIn, isNetworkSynced, isUsedOnRelease, onCraft, onStoppedUsing, postHit, postMine, postProcessTag, raycast, shouldSyncTagToClient, toString, usageTick, use, useOnBlock, useOnEntity
-
Field Details
-
material
-
-
Constructor Details
-
ToolItem
-
-
Method Details
-
getMaterial
-
getEnchantability
public int getEnchantability()Gets the enchantability of an item. This specifies the ability of an item to receive enchantments when enchanted using an enchanting table. As the value increases, the amount and level of enchantments applied increase.If the value of this method is 0, the item cannot be enchanted using an enchanting table.
- Overrides:
getEnchantability
in classItem
-
canRepair
-