Posted by Ragthor - Wednesday April 7, 2021
TweetHello! In this video we will learn to create a weapon, more specifically a sword, for our Add-on in a much easier way and without the need to edit the player.json
Items folder -> weapon.json
{
"format_version": "1.16.100",
"minecraft:item": {
"description": {
"category": "equipment",
"identifier": "tutorial:arma"
},
"components": {
"minecraft:creative_category": {
"parent": "itemGroup.name.sword"
},
"minecraft:max_stack_size": 1,
"minecraft:use_duration": 300,
"minecraft:hand_equipped": true,
"minecraft:allow_off_hand": true,
"minecraft:durability": {
"max_durability": 300,
"damage_chance": {
"min": 8,
"max": 8.5
}
},
"minecraft:repairable": {
"repair_items": [
{
"items": [
"minecraft:diamond_block"
],
"repair_amount": 1
}
]
},
"minecraft:mining_speed": 1.5,
"minecraft:damage": 18,
"minecraft:enchantable": {
"value": 8,
"slot": "sword"
},
"minecraft:can_destroy_in_creative": false,
"minecraft:digger": {
"use_efficiency": true,
"destroy_speeds": [
{
"block": "minecraft:web",
"speed": 11
}
]
},
"minecraft:weapon": {},
"tag:minecraft:is_sword": {},
"minecraft:icon": {
"texture": "arma"
},
"minecraft:display_name": {
"value": "Nombre Arma"
}
}
}
}
Items folder -> weapon.json
{
"format_version": "1.12.0",
"minecraft:item": {
"description": {
"identifier": "tutorial:arma",
"category": "Equipment"
},
"components": {
"minecraft:icon": "arma",
"minecraft:render_offsets": "miscellaneous"
}
}
}
Textures folder -> item_texture.json
{
"resource_pack_name": "tutorial",
"texture_name": "atlas.items",
"texture_data": {
"arma":
{
"textures":"textures/items/arma.png"
}
}
}
The weapon texture must be in the Textures -> Items folder.
Download code