block/item: Give swords and shears per-block mining speeds - #1440
Open
HashimTheArab wants to merge 1 commit into
Open
block/item: Give swords and shears per-block mining speeds#1440HashimTheArab wants to merge 1 commit into
HashimTheArab wants to merge 1 commit into
Conversation
Both tools returned one number for every block: 1.5 from shears, and 1.5 from a sword except on cobweb. Bedrock decides their speed from the block instead, and neither has a tier speed of its own. Shears get 15 on leaves and cobweb, 5 on wool and 2 on vines, so shearing wool was over three times too slow and cutting leaves or cobweb ten times too slow. A sword gets 15 on cobweb, 30 on bamboo and 1.5 on leaves, vines, moss carpet, pumpkins, melons and cocoa. Only cobweb reached it before, since the speed is gated on the block naming the tool effective and no other block named a sword. BaseMiningEfficiency now asks the block through SwordMineable and ShearsMineable, and the blocks that answer name the tool in Effective too. Glow lichen, chorus plant, chorus flower and big dripleaf also take 1.5 from a sword and are left out until those blocks exist.
HashimTheArab
force-pushed
the
feat/sword-shears-mining-speed
branch
from
August 17, 2026 17:12
971cff9 to
deeb9b4
Compare
xRookieFight
approved these changes
Aug 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Swords and shears each return a single number for every block:
1.5from shears, and1.5from a sword except on cobweb. Bedrock decides their speed from the block instead — neither tool has a tier speed of its own the way a pickaxe does.Shears
Bedrock sorts blocks into three tiers for shears:
Everything else is 1. So shearing wool was more than three times too slow, and cutting leaves or cobweb ten times too slow.
minecraft.wikilists the same numbers under Bedrock breaking speed ("Wool: 5, Leaves: 15, Cobweb: 15").Swords
15 on cobweb, 30 on bamboo and bamboo saplings, and 1.5 on leaves, vines, moss carpet, pumpkins, melons and cocoa. Everything else is 1 — a sword is no faster than a bare hand on stone.
Only cobweb reached that before. The speed is gated on the block naming the tool effective in its
BreakInfo, and no block other than cobweb named a sword, so the old1.5default was unreachable everywhere else.Shape
BaseMiningEfficiencyasks the block, through two new interfaces:That keeps the numbers next to the block that owns them, alongside its hardness and harvestability, and leaves
BreakDurationuntouched. The blocks that answer also name the tool in theirEffectivepredicate, which is what that predicate already means — "can be mined more effectively with the tool passed than with an empty hand" — and is true of a sword on leaves.anyEffectiveis a small combinator for the blocks that now have two tool types, replacing the hand-written closures.The resulting times line up with those published for Bedrock: wool with shears 0.25s, cobweb with shears 0.4s, leaves with shears 0.05s, leaves with a sword 0.2s against 0.3s bare-handed, and a pumpkin with a sword 1s.
Not covered
Glow lichen, chorus plant, chorus flower and big dripleaf also take 1.5 from a sword in Bedrock. There are no such blocks yet, so there is nothing to hang the method on.