public class ItemTool extends Item
Item.ToolMaterial
Modifier and Type | Field and Description |
---|---|
protected float |
efficiencyOnProperMaterial |
protected Item.ToolMaterial |
toolMaterial
The material this tool is made from.
|
bFull3D, canRepair, delegate, hasSubtypes, itemModifierUUID, itemRand, itemRegistry, maxStackSize
Modifier | Constructor and Description |
---|---|
protected |
ItemTool(float attackDamage,
Item.ToolMaterial material,
java.util.Set<Block> effectiveBlocks) |
Modifier and Type | Method and Description |
---|---|
float |
getDigSpeed(ItemStack stack,
IBlockState state)
Metadata-sensitive version of getStrVsBlock
|
int |
getHarvestLevel(ItemStack stack,
java.lang.String toolClass)
Queries the harvest level of this item stack for the specifred tool class,
Returns -1 if this tool is not of the specified type
|
boolean |
getIsRepairable(ItemStack toRepair,
ItemStack repair)
Return whether this item is repairable in an anvil.
|
<any> |
getItemAttributeModifiers() |
int |
getItemEnchantability()
Return the enchantability factor of the item, most of the time is based on material.
|
float |
getStrVsBlock(ItemStack stack,
Block block) |
java.util.Set<java.lang.String> |
getToolClasses(ItemStack stack) |
Item.ToolMaterial |
getToolMaterial() |
java.lang.String |
getToolMaterialName()
Return the name for this tool's material.
|
boolean |
hitEntity(ItemStack stack,
EntityLivingBase target,
EntityLivingBase attacker)
Current implementations of this method in child classes do not use the entry argument beside ev.
|
boolean |
isFull3D()
Returns True is the item is renderer in full 3D when hold.
|
boolean |
onBlockDestroyed(ItemStack stack,
World worldIn,
Block blockIn,
BlockPos pos,
EntityLivingBase playerIn)
Called when a Block is destroyed using this Item.
|
addInformation, canHarvestBlock, canHarvestBlock, canItemEditBlocks, createEntity, doesSneakBypassUse, getArmorModel, getArmorModel, getArmorTexture, getAttributeModifiers, getByNameOrId, getChestGenBase, getColorFromItemStack, getContainerItem, getContainerItem, getCreativeTab, getCreativeTabs, getDamage, getDurabilityForDisplay, getEntityLifespan, getFontRenderer, getHasSubtypes, getHighlightTip, getIdFromItem, getItemById, getItemEnchantability, getItemFromBlock, getItemStackDisplayName, getItemStackLimit, getItemStackLimit, getItemUseAction, getMaxDamage, getMaxDamage, getMaxItemUseDuration, getMetadata, getMetadata, getModel, getMovingObjectPositionFromPlayer, getPotionEffect, getRarity, getRegistryName, getShareTag, getSmeltingExperience, getSubItems, getUnlocalizedName, getUnlocalizedName, getUnlocalizedNameInefficiently, hasContainerItem, hasContainerItem, hasCustomEntity, hasEffect, initCapabilities, isBeaconPayment, isBookEnchantable, isDamageable, isDamaged, isItemTool, isMap, isPotionIngredient, isRepairable, isValidArmor, itemInteractionForEntity, onArmorTick, onBlockStartBreak, onCreated, onDroppedByPlayer, onEntityItemUpdate, onEntitySwing, onItemRightClick, onItemUse, onItemUseFinish, onItemUseFirst, onLeftClickEntity, onPlayerStoppedUsing, onUpdate, onUsingTick, registerItemBlock, registerItems, renderHelmetOverlay, setContainerItem, setCreativeTab, setDamage, setFull3D, setHarvestLevel, setHasSubtypes, setMaxDamage, setMaxStackSize, setNoRepair, setPotionEffect, setRegistryName, setRegistryName, setRegistryName, setUnlocalizedName, shouldCauseReequipAnimation, shouldRotateAroundWhenRendering, showDurabilityBar, updateItemStackNBT
protected float efficiencyOnProperMaterial
protected Item.ToolMaterial toolMaterial
protected ItemTool(float attackDamage, Item.ToolMaterial material, java.util.Set<Block> effectiveBlocks)
public float getStrVsBlock(ItemStack stack, Block block)
getStrVsBlock
in class Item
public boolean hitEntity(ItemStack stack, EntityLivingBase target, EntityLivingBase attacker)
public boolean onBlockDestroyed(ItemStack stack, World worldIn, Block blockIn, BlockPos pos, EntityLivingBase playerIn)
onBlockDestroyed
in class Item
public boolean isFull3D()
public Item.ToolMaterial getToolMaterial()
public int getItemEnchantability()
getItemEnchantability
in class Item
public java.lang.String getToolMaterialName()
public boolean getIsRepairable(ItemStack toRepair, ItemStack repair)
getIsRepairable
in class Item
public <any> getItemAttributeModifiers()
getItemAttributeModifiers
in class Item
public int getHarvestLevel(ItemStack stack, java.lang.String toolClass)
Item
getHarvestLevel
in class Item
stack
- This item stack instancetoolClass
- Tool Classpublic java.util.Set<java.lang.String> getToolClasses(ItemStack stack)
getToolClasses
in class Item
public float getDigSpeed(ItemStack stack, IBlockState state)
Item
getDigSpeed
in class Item
stack
- The Item Stackstate
- The block state