Bedrock Snippets

Custom Spear

View Source

custom_spear > bp > items > iron_spear.json

{
    "format_version": "1.16.100",
    "minecraft:item": {
        "description": {
            "identifier": "wiki:iron_spear",
            "category": "Equipment"
        },
        "components": {
            "tag:trident_tier_1": {},
            "minecraft:max_stack_size": 1,
            "minecraft:hand_equipped": true,
            "minecraft:creative_category": {
                "parent": "itemGroup.name.sword"
            },
            "minecraft:icon": {
                "texture": "iron_spear"
            },
            "minecraft:display_name": {
                "value": "item.wiki:iron_spear"
            },
            "minecraft:use_duration": 3600,
            "minecraft:throwable": {
                "min_draw_duration": 2,
                "max_draw_duration": 4,
                "scale_power_by_draw_duration": true
            },
            "minecraft:projectile": {
                "projectile_entity": "wiki:thrown_iron_spear",
                "minimum_critical_power": 1.0
            },
            "minecraft:durability": {
                "max_durability": 125
            },
            "minecraft:enchantable": {
                "value": 10,
                "slot": "trident"
              },
            "minecraft:repairable": {
                "repair_items": [
                    {
                        "items": [
                            "minecraft:crimson_planks",
                            "minecraft:planks",
                            "minecraft:warped_planks",
                            "minecraft:mangrove_planks"
                        ],
                        "repair_amount": "query.max_durability / 2"
                    },
                    {
                        "items": [
                            "wiki:iron_spear"
                        ],
                        "repair_amount": "context.other->query.remaining_durability * 0.8"
                    }
                ]
            }
        },
        "events": {
            "dmg": {
              "damage": {
                "type": "none",
                "amount": 1,
                "target": "self"
              }
            },
            "on_tool_used": {
              "swing": {},
              "damage": {
                "type": "none",
                "amount": 1,
                "target": "self"
              }
            },
            "gen:damage": {
              "damage": {
                "type": "none",
                "amount": 1,
                "target": "self"
              }
            }
          }
    }
}
Copied to Clipboard