mojira.dev
MC-271039

Upgrading to 1.20.5 leads to the removal of all enchantments if item had the "sweeping" enchantment without namespace

Summary:
Upgrading to 1.20.5 leads to the removal of all enchantments if item had the "sweeping" enchantment without namespace.
This problem started occurring in 24w03a when the namespace id of sweeping edge was changed.
https://www.minecraft.net/article/minecraft-snapshot-24w03a

The minecraft:sweeping enchantment has been renamed to minecraft:sweeping_edge

Before version 24w09a, only the sweeping edge enchantment was removed when upgrading. When upgrading to 24w09a and higher, all enchantments are removed from the item.

Steps to reproduce:
You can go straight to step 4 using this world:

[media]
  1. Create a world in 1.20.4

  2. /give @s netherite_sword{Enchantments:[{lvl:3,id:"sweeping"},{lvl:3,id:"unbreaking"}]}
    /give @s netherite_sword{Enchantments:[{lvl:3,id:"sweeping"},{lvl:3,id:"unbreaking"}]}
  3. /give @s netherite_sword{Enchantments:[{lvl:3,id:"sweeping"}]}
    /give @s netherite_sword{Enchantments:[{lvl:3,id:"sweeping"}]}
  4. Upgrade to 1.20.5.

  5. Look at enchantments on items.

Observed results:
Enchantments have been removed.

Expected results:
Enchantments are not removed.

Attachments

Comments 1

Log output:

21:35:02.132
cuq
Server thread
Tried to load invalid item: 'Not a number; Unknown registry key in ResourceKey[minecraft:root / minecraft:enchantment]: minecraft:levels missed input: {levels:{sweeping:3,unbreaking:3}}; Unknown registry key in ResourceKey[minecraft:root / minecraft:enchantment]: minecraft:sweeping missed input: {sweeping:3} missed input: {"minecraft:enchantments":{levels:{sweeping:3,unbreaking:3}}}'
21:35:02.133
cuq
Server thread
Tried to load invalid item: 'Not a number; Unknown registry key in ResourceKey[minecraft:root / minecraft:enchantment]: minecraft:levels missed input: {levels:{sweeping:3}}; Unknown registry key in ResourceKey[minecraft:root / minecraft:enchantment]: minecraft:sweeping missed input: {sweeping:3} missed input: {"minecraft:enchantments":{levels:{sweeping:3}}}'
21:35:02.132
cuq
Server thread
Tried to load invalid item: 'Not a number; Unknown registry key in ResourceKey[minecraft:root / minecraft:enchantment]: minecraft:levels missed input: {levels:{sweeping:3,unbreaking:3}}; Unknown registry key in ResourceKey[minecraft:root / minecraft:enchantment]: minecraft:sweeping missed input: {sweeping:3} missed input: {"minecraft:enchantments":{levels:{sweeping:3,unbreaking:3}}}'
21:35:02.133
cuq
Server thread
Tried to load invalid item: 'Not a number; Unknown registry key in ResourceKey[minecraft:root / minecraft:enchantment]: minecraft:levels missed input: {levels:{sweeping:3}}; Unknown registry key in ResourceKey[minecraft:root / minecraft:enchantment]: minecraft:sweeping missed input: {sweeping:3} missed input: {"minecraft:enchantments":{levels:{sweeping:3}}}'

[Mod] EVGENSYPERPRO

Panda4994

Confirmed

Platform

Important

Datafixer

24w03a, 24w09a, 1.20.5 Release Candidate 3, 1.20.5

24w18a

Retrieved