Skip to Content
CookbookCustom Sword with Attributes

Custom Sword with Attributes

Create a custom sword with attack damage, attack speed, and a unique display name using Minecraft 1.21.1+ components.

Item Type: Sprite Plugins: Nexo, CraftEngine Min MC Version: 1.21.1


Nexo

my_sword: itemname: "<gradient:#ff6b6b:#ee5a24>Inferno Blade" material: IRON_SWORD Pack: generate_model: false model: my_namespace/my_sword Components: max_stack_size: 1 max_damage: 500 tool: default_mining_speed: 1.0 damage_per_block: 1 rules: - block_types: - "#minecraft:sword_efficient" speed: 1.5 correct_for_drops: true attribute_modifiers: modifiers: - type: attack_damage amount: 12.0 operation: add_value slot: mainhand id: my_namespace:my_sword_damage - type: attack_speed amount: -2.4 operation: add_value slot: mainhand id: my_namespace:my_sword_speed

CraftEngine

my_sword: item-name: "<gradient:#ff6b6b:#ee5a24>Inferno Blade" data: material: IRON_SWORD generate-model: false model: my_namespace/my_sword components: max-stack-size: 1 max-damage: 500 tool: default-mining-speed: 1.0 damage-per-block: 1 rules: - block-types: - "#minecraft:sword_efficient" speed: 1.5 correct-for-drops: true attribute-modifiers: modifiers: - type: attack_damage amount: 12.0 operation: add_value slot: mainhand - type: attack_speed amount: -2.4 operation: add_value slot: mainhand

Notes

  • Attack damage of 12.0 is higher than a Netherite sword (8.0) — adjust to fit your server’s balance
  • Attack speed of -2.4 makes it slightly slower than a vanilla sword (-2.4 = 1.6 hits/sec)
  • The max_damage of 500 gives it about 3x the durability of an iron sword
  • The tool component enables efficient mining of sword-appropriate blocks (cobwebs, bamboo)
  • Upload your custom sword texture (16x16 PNG) and model (JSON) when generating