Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

The weapon helpers on Item.Properties

Generated from the 26.2 decompile by tools/gen_reference.py. Do not edit by hand.

The seven Item.Properties methods that turn a bare item into something you can hit with, what each one installs, and every item built by one. Item.Properties.tool is the shared body: pickaxe, axe, hoe and shovel are it with a mining tag and a shield-disable time filled in; sword and spear go their own way. Three of the six tool families need a class of their own because they also do something on right-click, and three are plain Items the helper alone describes. See items and stacks and data components.

helperdelegates tocomponents it setsattributes
Item.Properties.toolapplyToolPropertiesDataComponents.TOOL, DataComponents.WEAPONAttributes.ATTACK_DAMAGE, Attributes.ATTACK_SPEED (through ToolMaterial)
Item.Properties.pickaxetoolDataComponents.TOOL, DataComponents.WEAPONAttributes.ATTACK_DAMAGE, Attributes.ATTACK_SPEED (through ToolMaterial)
Item.Properties.axetoolDataComponents.TOOL, DataComponents.WEAPONAttributes.ATTACK_DAMAGE, Attributes.ATTACK_SPEED (through ToolMaterial)
Item.Properties.hoetoolDataComponents.TOOL, DataComponents.WEAPONAttributes.ATTACK_DAMAGE, Attributes.ATTACK_SPEED (through ToolMaterial)
Item.Properties.shoveltoolDataComponents.TOOL, DataComponents.WEAPONAttributes.ATTACK_DAMAGE, Attributes.ATTACK_SPEED (through ToolMaterial)
Item.Properties.swordapplySwordPropertiesDataComponents.TOOL, DataComponents.WEAPONAttributes.ATTACK_DAMAGE, Attributes.ATTACK_SPEED (through ToolMaterial)
Item.Properties.spearDataComponents.DAMAGE_TYPE, DataComponents.KINETIC_WEAPON, DataComponents.PIERCING_WEAPON, DataComponents.ATTACK_RANGE, DataComponents.MINIMUM_ATTACK_CHARGE, DataComponents.SWING_ANIMATION, DataComponents.USE_EFFECTS, DataComponents.WEAPONAttributes.ATTACK_DAMAGE, Attributes.ATTACK_SPEED

The 42 items built by one

damage and speed are the two baselines the call passes; the material adds its own attack-damage bonus on top.

itemhelpermaterialdamage baselinespeed baseline
Items.WOODEN_SWORDItem.Properties.swordToolMaterial.WOOD3.0-2.4
Items.WOODEN_SHOVELshovel (ShovelItem)ToolMaterial.WOOD1.5-3.0
Items.WOODEN_PICKAXEItem.Properties.pickaxeToolMaterial.WOOD1.0-2.8
Items.WOODEN_AXEaxe (AxeItem)ToolMaterial.WOOD6.0-3.2
Items.WOODEN_HOEhoe (HoeItem)ToolMaterial.WOOD0.0-3.0
Items.COPPER_SWORDItem.Properties.swordToolMaterial.COPPER3.0-2.4
Items.COPPER_SHOVELshovel (ShovelItem)ToolMaterial.COPPER1.5-3.0
Items.COPPER_PICKAXEItem.Properties.pickaxeToolMaterial.COPPER1.0-2.8
Items.COPPER_AXEaxe (AxeItem)ToolMaterial.COPPER7.0-3.2
Items.COPPER_HOEhoe (HoeItem)ToolMaterial.COPPER-1.0-2.0
Items.STONE_SWORDItem.Properties.swordToolMaterial.STONE3.0-2.4
Items.STONE_SHOVELshovel (ShovelItem)ToolMaterial.STONE1.5-3.0
Items.STONE_PICKAXEItem.Properties.pickaxeToolMaterial.STONE1.0-2.8
Items.STONE_AXEaxe (AxeItem)ToolMaterial.STONE7.0-3.2
Items.STONE_HOEhoe (HoeItem)ToolMaterial.STONE-1.0-2.0
Items.GOLDEN_SWORDItem.Properties.swordToolMaterial.GOLD3.0-2.4
Items.GOLDEN_SHOVELshovel (ShovelItem)ToolMaterial.GOLD1.5-3.0
Items.GOLDEN_PICKAXEItem.Properties.pickaxeToolMaterial.GOLD1.0-2.8
Items.GOLDEN_AXEaxe (AxeItem)ToolMaterial.GOLD6.0-3.0
Items.GOLDEN_HOEhoe (HoeItem)ToolMaterial.GOLD0.0-3.0
Items.IRON_SWORDItem.Properties.swordToolMaterial.IRON3.0-2.4
Items.IRON_SHOVELshovel (ShovelItem)ToolMaterial.IRON1.5-3.0
Items.IRON_PICKAXEItem.Properties.pickaxeToolMaterial.IRON1.0-2.8
Items.IRON_AXEaxe (AxeItem)ToolMaterial.IRON6.0-3.1
Items.IRON_HOEhoe (HoeItem)ToolMaterial.IRON-2.0-1.0
Items.DIAMOND_SWORDItem.Properties.swordToolMaterial.DIAMOND3.0-2.4
Items.DIAMOND_SHOVELshovel (ShovelItem)ToolMaterial.DIAMOND1.5-3.0
Items.DIAMOND_PICKAXEItem.Properties.pickaxeToolMaterial.DIAMOND1.0-2.8
Items.DIAMOND_AXEaxe (AxeItem)ToolMaterial.DIAMOND5.0-3.0
Items.DIAMOND_HOEhoe (HoeItem)ToolMaterial.DIAMOND-3.00.0
Items.NETHERITE_SWORDItem.Properties.swordToolMaterial.NETHERITE3.0-2.4
Items.NETHERITE_SHOVELshovel (ShovelItem)ToolMaterial.NETHERITE1.5-3.0
Items.NETHERITE_PICKAXEItem.Properties.pickaxeToolMaterial.NETHERITE1.0-2.8
Items.NETHERITE_AXEaxe (AxeItem)ToolMaterial.NETHERITE5.0-3.0
Items.NETHERITE_HOEhoe (HoeItem)ToolMaterial.NETHERITE-4.00.0
Items.WOODEN_SPEARItem.Properties.spearToolMaterial.WOOD0.650.7
Items.STONE_SPEARItem.Properties.spearToolMaterial.STONE0.750.82
Items.COPPER_SPEARItem.Properties.spearToolMaterial.COPPER0.850.82
Items.IRON_SPEARItem.Properties.spearToolMaterial.IRON0.950.95
Items.GOLDEN_SPEARItem.Properties.spearToolMaterial.GOLD0.950.7
Items.DIAMOND_SPEARItem.Properties.spearToolMaterial.DIAMOND1.051.075
Items.NETHERITE_SPEARItem.Properties.spearToolMaterial.NETHERITE1.151.2