Detalied dscription
When attempting to retrieve the result of a recipe to expantendig or locking a map (by minecraft:crafting_special_mapextending or by using a cartography tablet), if the item is not minecraft:filled_map, the game fails to perform the post-process and crashes because the item continues to contain the minecraft:map_post_processing component. With the following error:
The game crashed: mousereleased event handler
Error: java.lang.IllegalArgumentException: Failed to hash minecraft:map_post_processing=>SCALE: Component of type minecraft:map_post_processing is not encodableThe game crashed: mousereleased event handler
Error: java.lang.IllegalArgumentException: Failed to hash minecraft:map_post_processing=>SCALE: Component of type minecraft:map_post_processing is not encodableHow to reproduce
In crafting table
Create a data pack with a recipe of type
minecraft:crafting_special_mapextendingand a result other thanminecraft:filled_map. For example, the recipe:
{
"type": "minecraft:crafting_special_mapextending",
"map": "minecraft:filled_map",
"material": "minecraft:paper",
"result": {
"id": "minecraft:map"
}
}{
"type": "minecraft:crafting_special_mapextending",
"map": "minecraft:filled_map",
"material": "minecraft:paper",
"result": {
"id": "minecraft:map"
}
}Craft the recipe
Be careful not to have a vanilla recipe or one from another datapack overlapping the recipe.
For the craft to work, the
mapingredient must have theminecraft:map_idcomponent with an id that is already being used.
Try to get the result of the recipe.
In cartography tablet
Create an item with the
minecraft:map_idcomponent that is not theminecraft:filled_map.The map ID must already be in use for a valid map.
For example, use the command
/give @p map[minecraft:map_id=(n)], where(n)is the ID of a map that is already in use.
With a paper or a glass pane, place this item on the cartographt tablet.
Try to get the result of the recipe.
Code analysis
The method onCraftedPostProcess(ItemStack itemStack, Level level) is only non-empty for the minecraft:filled_map item; therefore, it does not process the component for all other items.
Move the method from the MapItem class to Item class would solve this bug. Although it would still leave the bug MC-303401
Notes
The bug in the craft table (now) only exists in version 26.1 Snapshot 5, as it wasn't possible to customize the recipe before then. However, the bug in the cartography table already existed before.
Important: The attached videos (by Aloi) shows some OBS Studio freezes that don't correspond to bugs in the game, and the cartography table video as well as a cut between the first crash and opening the world again. The game only freezes when click on the recipe result!
Thank you for helping us improve Minecraft! We saved your files: