Due to changes in data components, the shulker boxes script stopped working in 1.20.5/1.21. This PR makes shulkerboxes.sc compatible with 1.21 (and possibly 1.20.5, but I haven't tested it)
What changed
Data components migration
Count is now lowercase count
Shulker inventory has been moved. BlockEntityTag.Items is now components."minecraft:container"
Custom data should be stored in components."minecraft:custom_data"
Simplified some lines
Consistency: Renamed variables to be more consistent across functions
Formatting (remove trailing spaces, tabs were replaced with two spaces to be consistent with the rest of the file)
Testing (only tested in 1.21)
[x] The following modes that were affected
[x] vacuum
1 item
full stack
full stack where shulker has would be filled up, remaining should be picked up by the player
[x] restock same
[x] restock keep
[x] restock keep vacuum
[x] swap next
[x] swap same
[x] Potions refills
[x] Totem of undying
Note
I installed the vim plugin for scarpet, which reformatted the file, removing some trailing spaces. I can always split the PR into two if it needs to be more clear.
Due to changes in data components, the shulker boxes script stopped working in 1.20.5/1.21. This PR makes shulkerboxes.sc compatible with 1.21 (and possibly 1.20.5, but I haven't tested it)
What changed
Count
is now lowercasecount
BlockEntityTag.Items
is nowcomponents."minecraft:container"
components."minecraft:custom_data"
Testing (only tested in 1.21)
Note
I installed the vim plugin for scarpet, which reformatted the file, removing some trailing spaces. I can always split the PR into two if it needs to be more clear.