-
Bug
-
Resolution: Fixed
-
Minecraft 1.11.2, Minecraft 17w18b, Minecraft 1.12 Pre-Release 1, Minecraft 1.12 Pre-Release 2, Minecraft 1.12 Pre-Release 3, Minecraft 1.12.2, Minecraft 17w47b, Minecraft 18w14a, Minecraft 18w14b, Minecraft 18w15a, Minecraft 18w21a
-
Confirmed
The bug
Minecraft crashes when you put an item with invalid enchantments in the first slot of an anvil and an item with valid enchantments in the second one.
How to reproduce
- Give yourself an item with invalid enchantments
/give @p minecraft:diamond_boots 1 0 {ench:[{id:-1s}]}
- Get another item with valid enchantments
- Put the item with the invalid enchantments in the first slot and the one with the valid ones in the second one
Code analysis
Based on 1.11.2 decompiled using MCP 9.35 rc1
The method net.minecraft.inventory.ContainerRepair.updateRepairOutput() does not skip enchantments with the id null. However, it might be better to change the method net.minecraft.enchantment.EnchantmentHelper.getEnchantments(ItemStack) to not add not existing enchantments to the map in the first place.
Crash report
Description: Updating screen events java.lang.NullPointerException: Updating screen events at aii.c(SourceFile:105) at acm.e(SourceFile:251) at acm.a(SourceFile:154) at acm$1.x_(SourceFile:44) at rr.a(SourceFile:104) at adl.d(SourceFile:79) at acl.a(SourceFile:486) at acm.b(SourceFile:431) at acl.a(SourceFile:194) at bnp.a(SourceFile:413) at big.a(SourceFile:520) at big.a(SourceFile:342) at bih.a(SourceFile:125) at bho.k(SourceFile:404) at bho.p(SourceFile:381) at bes.t(SourceFile:1586) at bes.av(SourceFile:970) at bes.a(SourceFile:398) at net.minecraft.client.main.Main.main(SourceFile:124)
- is duplicated by
-
MC-114062 Applying a nonexistent enchantment to an item through an anvil crashes the game
- Resolved
-
MC-119432 Crash when using custom enchant levels
- Resolved
-
MC-128296 Game Crash While Using Unreal Enchantment ID & Real Enchantment ID inside Avnvil
- Resolved
-
MC-129516 Crash with enchantement in anvil.
- Resolved
- relates to
-
MC-32284 Placing an enchanted item with a non-existent ench ID will crash when placing it in the first slot of an anvil
- Resolved
-
MC-130169 Enchanted items with capitals in enchantment ID cause crash (path of location: minecraft:Cookie)
- Resolved