#Modify Mining Level of a Block

12 messages · Page 1 of 1 (latest)

crimson crescent
#

I'm migrating a script from 1.18 to 1.19 to set all the mining levels of sky stone blocks to diamond, which is a fairly simple program:

function modAE2BlockTags(event){
    const skyStoneBlocks = [
        "sky_stone_block", "smooth_sky_stone_block", "sky_stone_brick", "sky_stone_small_brick",
        "sky_stone_chest", "smooth_sky_stone_chest", "sky_stone_tank", "sky_stone_stairs",
        "smooth_sky_stone_stairs", "sky_stone_brick_stairs", "sky_stone_small_brick_stairs",
        "sky_stone_wall", "smooth_sky_stone_wall", "sky_stone_brick_wall",
        "sky_stone_small_brick_wall", "sky_stone_slab", "smooth_sky_stone_slab",
        "sky_stone_brick_slab", "sky_stone_small_brick_slab"
    ];
    
    skyStoneBlocks.forEach((e) => {
        e = "ae2:" + e;
        event.add('minecraft:needs_diamond_tool',e)
    });
}

While the function does indeed add the right tag to all blocks, it seems that the tag isn't actually capable of modifying the mining level of the blocks, as both jade and a mining test tell me that it can still be mined with iron tools.

Do mining levels work differently in 1.19.2 or is it an issue with my code?

keen lindenBOT
#

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

peak mist
#

did you remove the original tag? the minecraft:needs_iron_tool one

crimson crescent
#

I'll check

#

well, the advanced tooltip doesn't mention that tag, but I'll try removing it either way just in case

#

unfortunately the issue still persists

peak mist
#

and this runs in the block tag event?

crimson crescent
#

it seems it's running on the item tag ?

ServerEvents.tags('item', event => {
    modAE2BlockTags(event)
})```
#

should I replace that with 'block' ?

peak mist
#

yes

crimson crescent
#

yep that was it

#

thank you