mojira.dev
MC-133547

hotbar.nbt is not rewritten after being upgraded

The bug

After hotbar.nbt is upgraded, the file is not rewritten. This is noticeable in game by a minor lag spike that occurs when pressing the "Saved Toolbars" tab (occurs the first time every launch).

How to reproduce

  1. Add the attached

[media]
  1. (from 1.12.2) to your .minecraft directory

  2. Start up the game in the latest version

  3. Press the "Saved Toolbars" tab in the creative menu
    → Notice the game freezes for a split second

  4. (Optional) Open the hotbar.nbt file with a NBT editor
    → Notice the file was not rewritten to use new IDs

Linked issues

Attachments

Comments 1

Bee

I do not support Minecraft automatically rewriting hotbar.nbt. If players frequently switch versions or mod versions, it greatly affects them. I often play 1.20.4 and snapshot versions, and this will cause me to lose some data in hotbar.nbt when switching back to 1.20.4 after playing a snapshot version due to incompatibilities with Item Stack Components. Additionally, modded players will find that when they switch to vanilla Minecraft, Minecraft will delete invalid items in hotbar.nbt and rewrite hotbar.nbt.

This requires such players to back up hotbar.nbt themselves. I hope there can be a setting to allow players to decide whether to rewrite hotbar.nbt when it updates (suggested default is false).

This is just my idea.

[Mod] Neko

(Unassigned)

Confirmed

(Unassigned)

creative-inventory, hotbar

Minecraft 1.13-pre8, Minecraft 1.13-pre9, Minecraft 1.13, Minecraft 18w30a, Minecraft 18w30b, ..., 1.16.1, 20w27a, 1.20.4, 24w05a, 24w11a

Retrieved