Package net.minecraft.item
Class ToolItem
java.lang.Object
net.minecraft.item.Item
net.minecraft.item.ToolItem
- Direct Known Subclasses:
AxeItem,PickaxeItem,ShovelItem
public class ToolItem extends Item
- Mappings:
Namespace Name official zaintermediary net/minecraft/class_2031named net/minecraft/item/ToolItem
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.item.Item
Item.ToolMaterialType -
Field Summary
Fields Modifier and Type Field Description private floatattackDamageprivate Set<Block>effectiveBlocksprotected Item.ToolMaterialTypematerialprotected floatminingSpeedFields inherited from class net.minecraft.item.Item
ATTACK_DAMAGE_MODIFIER_UUID, damageable, handheld, maxCount, RANDOM, REGISTRY -
Constructor Summary
Constructors Modifier Constructor Description protectedToolItem(float attackDamage, Item.ToolMaterialType material, Set<Block> effectiveBlocks) -
Method Summary
Modifier and Type Method Description booleancanRepair(ItemStack stack, ItemStack ingredient)Returns whether the item can be repaired via an anvil or crafting table.Multimap<String,AttributeModifier>getAttributeModifierMap()Returns a map containing entity attributes that are modified by the itemintgetEnchantability()Returns the enchantability of an Item.Item.ToolMaterialTypegetMaterial()StringgetMaterialAsString()floatgetMiningSpeedMultiplier(ItemStack stack, Block block)booleanisHandheld()Returns whether the item is supposed to look as handheld.booleanonBlockBroken(ItemStack stack, World world, Block block, BlockPos pos, LivingEntity entity)booleanonEntityHit(ItemStack stack, LivingEntity entity1, LivingEntity entity2)Methods inherited from class net.minecraft.item.Item
appendItemStacks, appendTooltip, byRawId, canUseOnEntity, fromBlock, getDisplayColor, getDisplayName, getFromId, getItemGroup, getItemstackTranslatedName, getMaxCount, getMaxDamage, getMaxUseTime, getMeta, getRarity, getRawId, getRecipeRemainder, getStatusEffectString, getTranslationKey, getTranslationKey, getUseAction, hasEnchantmentGlint, hasStatusEffectString, hasSubTypes, inventoryTick, isDamageable, isEffectiveOn, isEnchantable, isFood, isNetworkSynced, isUnbreakable, onCraft, onFinishUse, onHit, onStartUse, onUseStopped, postProcessTag, registerBlockItem, setHandheld, setItemGroup, setMaxCount, setMaxDamage, setRecipeRemainder, setStatusEffectString, setTranslationKey, setUnbreakable, setup, shouldRotate, shouldSyncTagToClient, use
-
Field Details
-
effectiveBlocks
- Mappings:
Namespace Name Mixin selector official cLza;c:Ljava/util/Set;intermediary field_8574Lnet/minecraft/class_2031;field_8574:Ljava/util/Set;named effectiveBlocksLnet/minecraft/item/ToolItem;effectiveBlocks:Ljava/util/Set;
-
miningSpeed
protected float miningSpeed- Mappings:
Namespace Name Mixin selector official aLza;a:Fintermediary field_8572Lnet/minecraft/class_2031;field_8572:Fnamed miningSpeedLnet/minecraft/item/ToolItem;miningSpeed:F
-
attackDamage
private float attackDamage- Mappings:
Namespace Name Mixin selector official dLza;d:Fintermediary field_8575Lnet/minecraft/class_2031;field_8575:Fnamed attackDamageLnet/minecraft/item/ToolItem;attackDamage:F
-
material
- Mappings:
Namespace Name Mixin selector official bLza;b:Lzw$a;intermediary field_8573Lnet/minecraft/class_2031;field_8573:Lnet/minecraft/class_2054$class_2055;named materialLnet/minecraft/item/ToolItem;material:Lnet/minecraft/item/Item$ToolMaterialType;
-
-
Constructor Details
-
ToolItem
- Mappings:
Namespace Name Mixin selector official <init>Lza;<init>(FLzw$a;Ljava/util/Set;)Vintermediary <init>Lnet/minecraft/class_2031;<init>(FLnet/minecraft/class_2054$class_2055;Ljava/util/Set;)Vnamed <init>Lnet/minecraft/item/ToolItem;<init>(FLnet/minecraft/item/Item$ToolMaterialType;Ljava/util/Set;)V
-
-
Method Details
-
getMiningSpeedMultiplier
- Overrides:
getMiningSpeedMultiplierin classItem- Mappings:
Namespace Name Mixin selector official aLzw;a(Lzx;Lafh;)Fintermediary method_8262Lnet/minecraft/class_2054;method_8262(Lnet/minecraft/class_2056;Lnet/minecraft/class_160;)Fnamed getMiningSpeedMultiplierLnet/minecraft/item/Item;getMiningSpeedMultiplier(Lnet/minecraft/item/ItemStack;Lnet/minecraft/block/Block;)F
-
onEntityHit
- Overrides:
onEntityHitin classItem- Mappings:
Namespace Name Mixin selector official aLzw;a(Lzx;Lpr;Lpr;)Zintermediary method_8263Lnet/minecraft/class_2054;method_8263(Lnet/minecraft/class_2056;Lnet/minecraft/class_1752;Lnet/minecraft/class_1752;)Znamed onEntityHitLnet/minecraft/item/Item;onEntityHit(Lnet/minecraft/item/ItemStack;Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/entity/LivingEntity;)Z
-
onBlockBroken
public boolean onBlockBroken(ItemStack stack, World world, Block block, BlockPos pos, LivingEntity entity)- Overrides:
onBlockBrokenin classItem- Mappings:
Namespace Name Mixin selector official aLzw;a(Lzx;Ladm;Lafh;Lcj;Lpr;)Zintermediary method_8258Lnet/minecraft/class_2054;method_8258(Lnet/minecraft/class_2056;Lnet/minecraft/class_99;Lnet/minecraft/class_160;Lnet/minecraft/class_1372;Lnet/minecraft/class_1752;)Znamed onBlockBrokenLnet/minecraft/item/Item;onBlockBroken(Lnet/minecraft/item/ItemStack;Lnet/minecraft/world/World;Lnet/minecraft/block/Block;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/entity/LivingEntity;)Z
-
isHandheld
Returns whether the item is supposed to look as handheld.- Overrides:
isHandheldin classItem- Mappings:
Namespace Name Mixin selector official w_Lzw;w_()Zintermediary method_8305Lnet/minecraft/class_2054;method_8305()Znamed isHandheldLnet/minecraft/item/Item;isHandheld()Z
-
getMaterial
- Mappings:
Namespace Name Mixin selector official gLza;g()Lzw$a;intermediary method_8209Lnet/minecraft/class_2031;method_8209()Lnet/minecraft/class_2054$class_2055;named getMaterialLnet/minecraft/item/ToolItem;getMaterial()Lnet/minecraft/item/Item$ToolMaterialType;
-
getEnchantability
public int getEnchantability()Returns the enchantability of an Item. Used by tools and armor- Overrides:
getEnchantabilityin classItem- Returns:
- Enchantability
- See Also:
ToolItem,ArmorItem- Mappings:
Namespace Name Mixin selector official bLzw;b()Iintermediary method_8269Lnet/minecraft/class_2054;method_8269()Inamed getEnchantabilityLnet/minecraft/item/Item;getEnchantability()I
-
getMaterialAsString
- Mappings:
Namespace Name Mixin selector official hLza;h()Ljava/lang/String;intermediary method_8210Lnet/minecraft/class_2031;method_8210()Ljava/lang/String;named getMaterialAsStringLnet/minecraft/item/ToolItem;getMaterialAsString()Ljava/lang/String;
-
canRepair
Returns whether the item can be repaired via an anvil or crafting table.- Overrides:
canRepairin classItem- Mappings:
Namespace Name Mixin selector official aLzw;a(Lzx;Lzx;)Zintermediary method_8267Lnet/minecraft/class_2054;method_8267(Lnet/minecraft/class_2056;Lnet/minecraft/class_2056;)Znamed canRepairLnet/minecraft/item/Item;canRepair(Lnet/minecraft/item/ItemStack;Lnet/minecraft/item/ItemStack;)Z
-
getAttributeModifierMap
Returns a map containing entity attributes that are modified by the item- Overrides:
getAttributeModifierMapin classItem- Mappings:
Namespace Name Mixin selector official iLzw;i()Lcom/google/common/collect/Multimap;intermediary method_8291Lnet/minecraft/class_2054;method_8291()Lcom/google/common/collect/Multimap;named getAttributeModifierMapLnet/minecraft/item/Item;getAttributeModifierMap()Lcom/google/common/collect/Multimap;
-