Bedrock Snippets

Custom Sword

View Source

custom_sword > bp > items > sword.json

{
    "format_version": "1.21.70",
    "minecraft:item": {
        "description": {
            "identifier": "wiki:custom_sword",
            "menu_category": {
                "category": "equipment",
                "group": "minecraft:itemGroup.name.sword"
            }
        },
        "components": {
            "minecraft:max_stack_size": 1,
            "minecraft:hand_equipped": true,
            "minecraft:durability": {
                "max_durability": 600
            },
            "minecraft:damage": 10,
            "minecraft:enchantable": {
                "value": 10,
                "slot": "sword"
            },
            "minecraft:icon": "wiki:custom_sword",
            "minecraft:display_name": {
                "value": "Emerald Sword"
            },
            "minecraft:repairable": {
                "repair_items": [
                    {
                        "items": ["minecraft:emerald"],
                        "repair_amount": "context.other->q.remaining_durability + 0.05 * context.other->q.max_durability"
                    }
                ]
            },
            "minecraft:digger": {
                "use_efficiency": true,
                "destroy_speeds": [
                    {
                        "block": "minecraft:web",
                        "speed": 15
                    },
                    {
                        "block": "minecraft:bamboo",
                        "speed": 10
                    }
                ]
            }
        }
    }
}
Copied to Clipboard