Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Snapshot 24w09a NBT Changes #12

Closed
8 tasks done
Seeloewen opened this issue Mar 24, 2024 · 3 comments
Closed
8 tasks done

Snapshot 24w09a NBT Changes #12

Seeloewen opened this issue Mar 24, 2024 · 3 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@Seeloewen
Copy link
Owner

Seeloewen commented Mar 24, 2024

Edit 25.03.2024: Just found out that components are way bigger of a change, see comment below.

The recent snapshot 24w09a broke the entire datapack by randomly changing how NBT tags are formatted. This was done for "Performance improvements" and to make it more reliable in the future, but I don't really see how these changes are anything but annoying. Anyways, basically all loot tables that have NBT tags for their items need to be redone, so here`s a list of what changed in each loot table:

command_blocks.json: No changes
enchanted_books.json: {StoredEnchantments:[{id:bane_of_arthropods,lvl:1}]} => stored_enchantments={levels:{'minecraft:bane_of_arthropods':1}}
goat_horns.json: {instrument:"minecraft:ponder_goat_horn"} => instrument='minecraft:ponder_goat_horn'
lingering_potions.json: {Potion:"minecraft:strength"} => potion_contents={potion:'minecraft:strength'}
normal_items.json: No changes
other_items.json: No changes
paintings.json: {EntityTag:{variant:"minecraft:alban"}} => entity_data={variant:'minecraft:alban'}
potions.json: {Potion:"minecraft:strength"} => potion_contents={potion:'minecraft:strength'}
spawn_eggs.json: No changes
splash_potions.json: {Potion:"minecraft:strength"} => potion_contents={potion:'minecraft:strength'}
suspicious_stews.json: {Effects:[{EffectId:8,EffectDuration:120}]} => suspicious_stew=[{id:'minecraft:jump_boost',duration:120}]
tipped_arrows.json: {Potion:"minecraft:strength"} => potion_contents={potion:'minecraft:strength'}

As you can probably see, all of these changes are pretty small and only affect formatting, yet they require rewriting a bunch of code. FOrtunately, because these changes are all quite similar, they can be done using a script/tool, which takes the values out of the old tags and puts them into the new ones. I will soon provide a tool which can be used to update existing datapacks to the 24w09a changes. Please note that this tool will most likely only work with datapack made for 1.20.4+ because of the structure.

To-Do for RIG Snapshot 24w09a Updater Software:

  • Fix final issues and exceptions
  • Improve completion message
  • Add about window
  • Add notice which datapacks it works best with
  • Finalize AssemblyInfo
  • Add comments
  • Upload both exe file and code to RIG repository, under a new folder "tools"
  • Fix paintings not being converted correctly
@Seeloewen Seeloewen added bug Something isn't working enhancement New feature or request labels Mar 24, 2024
@Seeloewen Seeloewen self-assigned this Mar 24, 2024
@Seeloewen Seeloewen mentioned this issue Mar 24, 2024
9 tasks
@Seeloewen
Copy link
Owner Author

Seeloewen commented Mar 25, 2024

Turns out Mojangs documentation on their new components changes is absolutely incomplete. Not once was mentioned that components in loot tables have to be structured completely different from how they appear ingame. While I thought they'd just go into the NBT tag field from before, they need a whole new JSON array. The tool for converting the loot tables is basically done, I only need to redo half of the software because they new syntax is way more complicated. Shouldn't be too hard though as the base is already there. Still, this is bullshit in my opinion. Thank you Mojang for this amazing change!

@Seeloewen
Copy link
Owner Author

The update of the tool is now done and I'm close to releasing it. The conversion is working perfectly, I'm just fixing some edge cases and adding some information here and there. You can see a to-do list in the issue above.

@Seeloewen
Copy link
Owner Author

The software is now done and can be downloaded for you to update your own Random Item Giver datapacks: https://github.com/Seeloewen/Random-Item-Giver-Datapack/raw/main/Tools/RIG%2024w09a%20Updater/Builds/RIG%2024w09a%20Updater%201.0.0.exe

The official Random Item Giver has also been fixed and now uses the new components. The changes will ship with the next beta.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
Development

No branches or pull requests

1 participant