scarpet icon indicating copy to clipboard operation
scarpet copied to clipboard

silk_spawners.sc doesnt work as exepcted

Open wh0oo opened this issue 4 years ago • 6 comments

I am using the latest of everything as of this minute. Latest carpet works fine for me in 21w08b, however silk_spawners.sc does not, the spawner just breaks.

wh0oo avatar Mar 08 '21 06:03 wh0oo

I did some more testing, and when using a netherite pick, it works. This appears to be specific to diamond pickaxes.

wh0oo avatar Mar 08 '21 08:03 wh0oo

IIRC it was changed to require a netherite pickaxe no long ago.

Edit: Looking back at it, it should allow both...

altrisi avatar Mar 08 '21 08:03 altrisi

I have another issue to add -- when placing a spawner that has been renamed with the aqua NBT tag stuff, there are actually two spawners placed. This doesnt happen when setting down spawners that have not been renamed, and doesnt happen at all if the script is unloaded..

wh0oo avatar Mar 08 '21 16:03 wh0oo

Line 17 is if (!tool || get(tool, 0) != 'diamond_pickaxe', !tool || get(tool, 0) != 'netherite_pickaxe', return()); Or with whitespace

if (!tool || get(tool, 0) != 'diamond_pickaxe',
    !tool || get(tool, 0) != 'netherite_pickaxe',
    return()
);

It's literally if(cond, cond, expr); which is wrong. It should be

if (
    !tool ||
    (get(tool, 0) != 'diamond_pickaxe' && get(tool, 0) != 'netherite_pickaxe'),
    return()
);

rv3r avatar Jan 31 '23 01:01 rv3r

Additionally, the spawner is always renamed to "Null Spawner" because the block nbt structure must've changed. Line 32 has data:'SpawnData.id' which should now be data:'SpawnData.entity.id'.

And line 46 prevents setting from the offhand.

And apparently you don't have to shift click on some blocks to place the spawner anyway (eg right click on anything with a gui with spawner in hand).

rv3r avatar Jan 31 '23 01:01 rv3r

I have another issue to add -- when placing a spawner that has been renamed with the aqua NBT tag stuff, there are actually two spawners placed. This doesnt happen when setting down spawners that have not been renamed, and doesnt happen at all if the script is unloaded..

Could you describe exactly how to reproduce this behavior? I haven't used the script much so I've never had this happen to me.

rv3r avatar Jan 31 '23 01:01 rv3r