Skip to content

These docs were made completely by AI, so they might be right, or wrong, you'll need to test them yourself. This was made for a easier understanding of everything. So use at your own risk. If anything is wrong, please don't hurt to make a PR on the page you have a problem with. ON GITHUB

Tools & Weapons

Tools and weapons are the main interactive items in LCE. They all share a Tier system that controls durability, mining speed, attack damage, and enchantability.

Key source files: Minecraft.World/WeaponItem.h, Minecraft.World/DiggerItem.h, Minecraft.World/PickaxeItem.h, Minecraft.World/ShovelItem.h, Minecraft.World/HatchetItem.h, Minecraft.World/HoeItem.h, Minecraft.World/ShearsItem.h, Minecraft.World/FishingRodItem.h

Defined in: Item::Tier (nested class in Item.h), instantiated as _Tier in Item.cpp

Each tier sets the mining level, durability, mining speed, attack damage bonus, and enchantability:

const Tier *WOOD = new Tier(0, 59, 2.0f, 0, 15);
const Tier *STONE = new Tier(1, 131, 4.0f, 1, 5);
const Tier *IRON = new Tier(2, 250, 6.0f, 2, 14);
const Tier *DIAMOND = new Tier(3, 1561, 8.0f, 3, 10);
const Tier *GOLD = new Tier(0, 32, 12.0f, 0, 22);
TierLevelDurabilitySpeedDamage BonusEnchantability
Wood0592.0+015
Stone11314.0+15
Iron22506.0+214
Diamond315618.0+310
Gold03212.0+022

Gold is interesting: it has the fastest mining speed (12.0) and highest enchantability (22), but it breaks super quickly (32 durability) and has a mining level of 0, same as Wood.

Tier(int level, int uses, float speed, int damage, int enchantmentValue);
ParameterFieldGetter
levelMining level (what blocks you can harvest)getLevel()
usesNumber of uses before breakinggetUses()
speedMining speed multipliergetSpeed()
damageAttack damage bonus added on top of basegetAttackDamageBonus()
enchantmentValueHow good enchantments are at the enchanting tablegetEnchantmentValue()

The getTierItemId() method figures out which item can repair a tool on the anvil. It uses pointer identity checks (comparing the this pointer against the static tier constants):

TierRepair Item
WoodPlanks (Tile::wood_Id)
StoneCobblestone (Tile::stoneBrick_Id)
IronIron Ingot (265)
DiamondDiamond (264)
GoldGold Ingot (266)

If none of the checks match (like for a custom tier), it returns -1 meaning no repair item.

Files: Minecraft.World/WeaponItem.h, Minecraft.World/WeaponItem.cpp

Swords deal a base damage of 4 + tier damage bonus. The constructor sets maxStackSize = 1 and maxDamage from the tier’s uses.

WeaponItem(int id, const Tier *tier);
PropertyValue
Base attack damage4 + tier bonus
Cobweb destroy speed15.0
All other blocks1.5

Swords use UseAnim_block for blocking. When you right-click, getUseDuration() returns 72,000 ticks (one hour: 20 * 60 * 60). In practice you release the button way before that. While blocking, incoming damage is reduced.

ActionDurability cost
Hit an enemy1
Mine a block (nonzero destroy speed)2

The hurtEnemy() method calls itemInstance->hurt(1, attacker) and returns true. The mineBlock() method calls itemInstance->hurt(2, owner) but only if the tile has a nonzero destroy speed.

SwordIDTotal DamageDurability
Wood2684 (4+0)59
Stone2725 (4+1)131
Iron2676 (4+2)250
Diamond2767 (4+3)1561
Gold2834 (4+0)32

canDestroySpecial() returns true for cobwebs (Tile::web), meaning swords can harvest cobwebs and drop string.

getEnchantmentValue() returns the tier’s enchantment value.

Files: Minecraft.World/DiggerItem.h, Minecraft.World/DiggerItem.cpp

This is the base class for pickaxes, shovels, and axes. Each subclass defines a list of “diggable” tiles stored as a TileArray (typedef for vector<Tile *>).

DiggerItem(int id, int baseAttackDamage, const Tier *tier, TileArray *diggables);

The constructor does:

  • Sets maxStackSize = 1
  • Sets maxDamage from tier->getUses()
  • Stores attackDamage = baseAttackDamage + tier->getAttackDamageBonus()
  • Stores the tier and diggable list

getDestroySpeed() checks if the tile is in the diggable list. If yes, returns the tier’s speed. If no, returns 1.0 (base speed, same as punching).

ActionDurability cost
Hit an enemy2
Mine a block (nonzero destroy speed)1

Note this is the opposite of swords. Tools cost more to hit enemies but less to mine blocks.

getEnchantmentValue() returns the tier’s enchantment value.

isValidRepairItem() calls Tier::getTierItemId() and checks if the repair item’s ID matches.

Files: Minecraft.World/PickaxeItem.h, Minecraft.World/PickaxeItem.cpp

Base attack damage parameter: 2 (total = 2 + tier bonus).

Stone Brick, Stone Slab, Stone Slab Half, Rock, Sandstone, Mossy Cobblestone, Iron Ore, Iron Block, Coal Ore, Gold Block, Gold Ore, Diamond Ore, Diamond Block, Ice, Netherrack, Lapis Ore, Lapis Block, Redstone Ore, Lit Redstone Ore, Rail, Detector Rail, Golden Rail.

Beyond the diggable list, getDestroySpeed() also gives the tier speed bonus on any tile whose material is Material::metal, Material::heavyMetal, or Material::stone.

canDestroySpecial() checks the tier level against specific blocks:

BlockMin Tier LevelMinimum Tier
Obsidian3Diamond only
Diamond Ore/Block2Iron+
Emerald Ore/Block2Iron+
Gold Ore/Block2Iron+
Redstone Ore (both states)2Iron+
Iron Ore/Block1Stone+
Lapis Ore/Block1Stone+
Any stone material0Any pickaxe
Any metal/heavy metal0Any pickaxe

If you mine a block that needs a higher tier, it takes forever and drops nothing.

PickaxeIDTotal DamageDurability
Wood2702 (2+0)59
Stone2743 (2+1)131
Iron2574 (2+2)250
Diamond2785 (2+3)1561
Gold2852 (2+0)32

Files: Minecraft.World/ShovelItem.h, Minecraft.World/ShovelItem.cpp

Base attack damage parameter: 1 (total = 1 + tier bonus).

Grass, Dirt, Sand, Gravel, Top Snow, Snow, Clay, Farmland, Soul Sand (hellSand), Mycelium (mycel).

canDestroySpecial() returns true for Top Snow (Tile::topSnow) and Snow blocks (Tile::snow). This means shovels can harvest snow and get snowballs.

ShovelIDTotal DamageDurability
Wood2691 (1+0)59
Stone2732 (1+1)131
Iron2563 (1+2)250
Diamond2774 (1+3)1561
Gold2841 (1+0)32

Files: Minecraft.World/HatchetItem.h, Minecraft.World/HatchetItem.cpp

Base attack damage parameter: 3 (total = 3 + tier bonus). Axes deal the most damage of any mining tool.

Planks (Tile::wood), Bookshelf, Logs (Tile::treeTrunk), Chest, Stone Slab, Stone Slab Half, Pumpkin, Lit Pumpkin.

Beyond the diggable list, getDestroySpeed() also gives the tier speed bonus on any tile with Material::wood.

AxeIDTotal DamageDurability
Wood2713 (3+0)59
Stone2754 (3+1)131
Iron2585 (3+2)250
Diamond2796 (3+3)1561
Gold2863 (3+0)32

Files: Minecraft.World/HoeItem.h, Minecraft.World/HoeItem.cpp

Hoes turn grass and dirt blocks into farmland. They are not mining tools, so they have no diggable tile list and no getDestroySpeed() override.

The useOn() method runs these checks:

  1. The face must not be 0 (not the bottom of a block).
  2. The player must be able to use the block at that position.
  3. The block above must be air.
  4. The target block must be grass (Tile::grass) or dirt (Tile::dirt).

If all checks pass, it plays the step.gravel sound and sets the block to farmland (Tile::farmland). Uses 1 durability per tilling action.

Hoes do not override getEnchantmentValue(), so they return 0 (the Item base class default). This means hoes cannot get enchantments at the enchanting table.

The constructor calls handEquipped() so hoes render like tools when held.

HoeIDDurability
Wood29059
Stone291131
Iron292250
Diamond2931561
Gold29432

Files: Minecraft.World/ShearsItem.h, Minecraft.World/ShearsItem.cpp

PropertyValue
ID359
Max Durability238
Stack Size1
TileDestroy SpeedCan Harvest (via canDestroySpecial)
Cobweb15.0Yes (drops string)
Leaves15.0No (normal leaf drops)
Wool5.0No (normal wool drops)
Redstone Dust1.0Yes
Tripwire1.0Yes

The mineBlock() override uses 1 durability when mining these specific tiles: leaves, cobweb, tall grass, vines, and tripwire. For all other blocks, it falls through to the default Item::mineBlock() behavior (which does nothing for shears).

Shears do not override getEnchantmentValue(), so they return 0 from the base Item class. You cannot enchant shears at an enchanting table.

Files: Minecraft.World/FishingRodItem.h, Minecraft.World/FishingRodItem.cpp

PropertyValue
ID346
Max Durability64
Stack Size1
Hand EquippedYes
Mirrored ArtYes (isMirroredArt = true)

Right-click toggles between casting and reeling:

  1. If the player already has a fishing hook out: calls FishingHook::retrieve() on the hook entity. The return value becomes the durability damage. Then it plays the random.bow sound at pitch 0.4.
  2. If no hook is out: creates a new FishingHook entity and adds it to the level. Plays the random.bow sound at pitch 0.5. Does not cost durability.

When a fishing hook is active, the item texture changes to TEXTURE_EMPTY (the “fishing rod cast” variant).

Fishing rods do not override getEnchantmentValue(), returning 0 from the base class.

IDItemClassTier
256Iron ShovelShovelItemIron
257Iron PickaxePickaxeItemIron
258Iron AxeHatchetItemIron
267Iron SwordWeaponItemIron
268Wood SwordWeaponItemWood
269Wood ShovelShovelItemWood
270Wood PickaxePickaxeItemWood
271Wood AxeHatchetItemWood
272Stone SwordWeaponItemStone
273Stone ShovelShovelItemStone
274Stone PickaxePickaxeItemStone
275Stone AxeHatchetItemStone
276Diamond SwordWeaponItemDiamond
277Diamond ShovelShovelItemDiamond
278Diamond PickaxePickaxeItemDiamond
279Diamond AxeHatchetItemDiamond
283Gold SwordWeaponItemGold
284Gold ShovelShovelItemGold
285Gold PickaxePickaxeItemGold
286Gold AxeHatchetItemGold
290Wood HoeHoeItemWood
291Stone HoeHoeItemStone
292Iron HoeHoeItemIron
293Diamond HoeHoeItemDiamond
294Gold HoeHoeItemGold
346Fishing RodFishingRodItem
359ShearsShearsItem

The tool and weapon system is basically the same between LCEMP and MinecraftConsoles. No new tool tiers, no new tool types. The Tier values, durability costs, diggable tile lists, and mining level requirements are all identical.

The only real change is a naming thing: ShearsItem gains a canHarvest check for some new blocks (like stained glass panes if they exist in tile form), but the core shears behavior is the same.