mojira.dev
MCPE-227906

minecraft:repairable component doesn't always allow for repair in anvils

Using the “minecraft:repairable” component, specifying a repair_item for a custom item, and trying to repair it in an anvil produces mixed results. This is not the case for a vanilla diamond sword item, which works as expected.

If “repair_amount” is set to "600" (arbitrary value), and there’s more than one repair item in the repair item slot - the anvil will get damaged and make a repair sound, but the items will pop into the player’s inventory for a second and come back to the anvil interface. The item does get repaired if only one repair item is used.

If “repair_amount” is set to "context.other->query.remaining_durability + 0.05 * context.other->query.max_durability" (as documentation suggests) then the anvil does not allow further interaction to repair the item.

If “repair_amount” is set to "q.max_durability * 0.25" (as another documentation example shows) then the behavior is the same as for the first case with “600”.

In the attached video, the apple, bread and carrot items are using the three “repair_amount” values respectively. A world with the behavior pack is also attached.

Here’s a JSON of one of the item files:

{
    "format_version": "1.21.70",
    "minecraft:item": {
        "description": {
            "identifier": "custom:axe_2",
            "menu_category": {
                "category": "equipment",
                "group": "minecraft:itemGroup.name.axe"
            }
        },
        "components": {
            "minecraft:custom_components": [
                "custom:damage_when_mining"
            ],
            "minecraft:max_stack_size": 1,
            "minecraft:hand_equipped": true,
            "minecraft:durability": {
                "max_durability": 1562
            },
            "minecraft:icon": "bread",
            "minecraft:repairable": {
                "repair_items": [
                    {
                        "items": [ "custom:repair_item" ],
                        "repair_amount": "context.other->query.remaining_durability + 0.05 * context.other->query.max_durability"
                    }
                ]
            },
            "minecraft:digger": {
                "use_efficiency": true,
                "destroy_speeds": [
                    {
                        "block": {
                            "tags": "query.any_tag('minecraft:is_axe_item_destructible')"
                        },
                        "speed": 10
                    }
                ]
            }
        }
    }
}

Attachments

Comments 2

Thank you for your report!
However, this issue is Working as Intended.

Please note, that mechanics of the game may change between updates.
Things such as graphics, sounds, world creation, biomes, redstone, villagers, and animals may not work the same in current versions.

Full Version History -- Snapshot Version History -- Feature Requests and Suggestions

Quick Links:
📓 Bug Tracker Guidelines -- 💬 Community Support -- 📧 Mojang Support (Technical Issues) -- 📧 Microsoft Support (Account Issues) -- 📓 Project Summary -- ✍️ Feedback and Suggestions -- 📖 Game Wiki

This bug was fixed in 1.21.111 and mentioned in the official changelog, though without linking to this issue https://www.minecraft.net/en-us/article/the-copper-age---minecraft--bedrock-edition-1-21-111-changelog

“Repairing an item using the minecraft:repairable item component no longer fails when a stack larger than strictly needed is used as repair material”

The status should be “Fixed” rather than “Working as Intended” and 1.21.111 should be listed as a Fix Version.

M

(Unassigned)

1488548

Confirmed

Windows

1.21.101 Hotfix

Retrieved