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.3 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. The components column names what a helper sets by name; through Item.Properties.durability, Item.Properties.repairable, Item.Properties.enchantable and Item.Properties.attributes every one also sets the durability components and a stack size of one, and the repair, enchantability and attribute-modifier components. 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. None of the six needs a class of its own: axe, hoe and shovel add DataComponents.BLOCK_TRANSFORMER, which the base Item.useOn runs on a right-click, so every item a helper builds is a plain Item. 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.BLOCK_TRANSFORMER, DataComponents.TOOL, DataComponents.WEAPONAttributes.ATTACK_DAMAGE, Attributes.ATTACK_SPEED (through ToolMaterial)
Item.Properties.hoetoolDataComponents.BLOCK_TRANSFORMER, DataComponents.TOOL, DataComponents.WEAPONAttributes.ATTACK_DAMAGE, Attributes.ATTACK_SPEED (through ToolMaterial)
Item.Properties.shoveltoolDataComponents.BLOCK_TRANSFORMER, DataComponents.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.spear—DataComponents.DAMAGE_TYPE, DataComponents.KINETIC_WEAPON, DataComponents.PIERCING_WEAPON, DataComponents.ATTACK_RANGE, DataComponents.MINIMUM_ATTACK_CHARGE, DataComponents.ATTACK_ANIMATION, DataComponents.USE_EFFECTS, DataComponents.WEAPONAttributes.ATTACK_DAMAGE, Attributes.ATTACK_SPEED

The 42 items built by one

damage and speed are the two baselines a tool or sword call passes; the material adds its own attack-damage bonus on top. A spear’s call passes an attack duration and a damage multiplier instead, so its row leaves both cells empty.

itemhelpermaterialdamage baselinespeed baseline
Items.WOODEN_SWORDItem.Properties.swordToolMaterial.WOOD3.0-2.4
Items.WOODEN_SHOVELItem.Properties.shovelToolMaterial.WOOD1.5-3.0
Items.WOODEN_PICKAXEItem.Properties.pickaxeToolMaterial.WOOD1.0-2.8
Items.WOODEN_AXEItem.Properties.axeToolMaterial.WOOD6.0-3.2
Items.WOODEN_HOEItem.Properties.hoeToolMaterial.WOOD0.0-3.0
Items.COPPER_SWORDItem.Properties.swordToolMaterial.COPPER3.0-2.4
Items.COPPER_SHOVELItem.Properties.shovelToolMaterial.COPPER1.5-3.0
Items.COPPER_PICKAXEItem.Properties.pickaxeToolMaterial.COPPER1.0-2.8
Items.COPPER_AXEItem.Properties.axeToolMaterial.COPPER7.0-3.2
Items.COPPER_HOEItem.Properties.hoeToolMaterial.COPPER-1.0-2.0
Items.STONE_SWORDItem.Properties.swordToolMaterial.STONE3.0-2.4
Items.STONE_SHOVELItem.Properties.shovelToolMaterial.STONE1.5-3.0
Items.STONE_PICKAXEItem.Properties.pickaxeToolMaterial.STONE1.0-2.8
Items.STONE_AXEItem.Properties.axeToolMaterial.STONE7.0-3.2
Items.STONE_HOEItem.Properties.hoeToolMaterial.STONE-1.0-2.0
Items.GOLDEN_SWORDItem.Properties.swordToolMaterial.GOLD3.0-2.4
Items.GOLDEN_SHOVELItem.Properties.shovelToolMaterial.GOLD1.5-3.0
Items.GOLDEN_PICKAXEItem.Properties.pickaxeToolMaterial.GOLD1.0-2.8
Items.GOLDEN_AXEItem.Properties.axeToolMaterial.GOLD6.0-3.0
Items.GOLDEN_HOEItem.Properties.hoeToolMaterial.GOLD0.0-3.0
Items.IRON_SWORDItem.Properties.swordToolMaterial.IRON3.0-2.4
Items.IRON_SHOVELItem.Properties.shovelToolMaterial.IRON1.5-3.0
Items.IRON_PICKAXEItem.Properties.pickaxeToolMaterial.IRON1.0-2.8
Items.IRON_AXEItem.Properties.axeToolMaterial.IRON6.0-3.1
Items.IRON_HOEItem.Properties.hoeToolMaterial.IRON-2.0-1.0
Items.DIAMOND_SWORDItem.Properties.swordToolMaterial.DIAMOND3.0-2.4
Items.DIAMOND_SHOVELItem.Properties.shovelToolMaterial.DIAMOND1.5-3.0
Items.DIAMOND_PICKAXEItem.Properties.pickaxeToolMaterial.DIAMOND1.0-2.8
Items.DIAMOND_AXEItem.Properties.axeToolMaterial.DIAMOND5.0-3.0
Items.DIAMOND_HOEItem.Properties.hoeToolMaterial.DIAMOND-3.00.0
Items.NETHERITE_SWORDItem.Properties.swordToolMaterial.NETHERITE3.0-2.4
Items.NETHERITE_SHOVELItem.Properties.shovelToolMaterial.NETHERITE1.5-3.0
Items.NETHERITE_PICKAXEItem.Properties.pickaxeToolMaterial.NETHERITE1.0-2.8
Items.NETHERITE_AXEItem.Properties.axeToolMaterial.NETHERITE5.0-3.0
Items.NETHERITE_HOEItem.Properties.hoeToolMaterial.NETHERITE-4.00.0
Items.WOODEN_SPEARItem.Properties.spearToolMaterial.WOOD——
Items.STONE_SPEARItem.Properties.spearToolMaterial.STONE——
Items.COPPER_SPEARItem.Properties.spearToolMaterial.COPPER——
Items.IRON_SPEARItem.Properties.spearToolMaterial.IRON——
Items.GOLDEN_SPEARItem.Properties.spearToolMaterial.GOLD——
Items.DIAMOND_SPEARItem.Properties.spearToolMaterial.DIAMOND——
Items.NETHERITE_SPEARItem.Properties.spearToolMaterial.NETHERITE——