gnembon / scarpet

Public Repository of scarpet programs for Minecraft
Creative Commons Zero v1.0 Universal
359 stars 162 forks source link

shulkerboxes.sc not working in 1.21 #392

Open AMilli2 opened 5 months ago

AMilli2 commented 5 months ago

I tried using the vacuum function in version 1.21, but the items keep going to the player's inventory.

manchesterjm commented 5 months ago

Yep, seeing the same thing in 1.21

manchesterjm commented 4 months ago

any easy fix here? what line of code needs to be updated?

samule-i commented 3 months ago

any easy fix here? what line of code needs to be updated?

I don't think it's an "easy" fix.

1.21 has changed a lot of how nbt data works For example, when checking the shulkerbox's name has 'vacuum' it reads shulker_tag:'display.Name on line 137

This doesn't return anything anymore, I've found that you can get the same data using shulker_tag:'components':'minecraft:custom_name', but there might be a better way to access it and I'm just not familiar enough.

This happens repeatedly through the code, any time that shulkerboxes accessed nbt data, it's almost guaranteed to have been moved in the changes.

As for which line specifically? So far, any line that uses shulker_tag probably needs looking at, as least.