#Unable to set digSpeed of individual tools

18 messages · Page 1 of 1 (latest)

dusky dust
#

Heyo, I am unable to set the digSpeed of tools in 1.21.1

I have a startup_script with the following code:

ItemEvents.modification(event => {
    event.modify([
        'minecraft:wooden_pickaxe',
        'minecraft:wooden_axe',
        'minecraft:wooden_shovel',
        'minecraft:wooden_hoe',
        'minecraft:wooden_sword'
    ], item => {item.digSpeed = 4})
})

But I get the error:
Error in 'ItemEvents.modification': [...] ItemModifications has no public instance field or method named digSpeed

Is there any fix for this? I understand you are normally supposed to use tiers for this but they are broken in 1.21, so am I just out of luck?

split furnaceBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

dusky dust
#

Seems like this is a 2 year old issue :(

fierce wasp
#

@dusky dust you are doing it wrong

it is

... => {
  item.setTier(tier => {tier.setSpeed(42)})
}

use this big number as a test, make sure to get new items, not old ones

dusky dust
fierce wasp
#

@dusky dust what is the value of Netherite Pickaxe?

dusky dust
#

both of these had just been /give-en to me

fierce wasp
#

@dusky dust try 9 too, maybe they don't like too high numbers

dusky dust
#

Will do, thanks

fierce wasp
#

So?

dusky dust
#

Nope, still doesn't work :(

fierce wasp
#

riperino

dusky dust
# fierce wasp riperino

Indeed. I also tried ‘item.tier = tier => tier.setSpeed(9)’ and while it changed the tooltip it didn’t actually change the functionality. I even tried making a new world.

dusky dust
#

Updating to the newest version of KubeJS and KubeJS tweaks fixes this issue funnily enough, but of course MI is broken with the newest KubeJS sadge

#

They have a open PR that fixes that but just waiting for it to be merged and then a hotfix/update to be released