#Custom Item/Weapon Damage

1 messages · Page 1 of 1 (latest)

grizzled geyser
#

Is there any way to create such a high damage value for the item without limitations? because even though I wanna make a powerful ultimate melee weapon that has damage with ranges between hundreds of thousands to millions and it needs to work with these for my weapon.

potent plank
grizzled geyser
#

Like this one I figured a while ago

#

world.afterEvents.entityHurt.subscribe(event => {
    const victim = event.hurtEntity;
    const src = event.damageSource;
    if (!victim?.hasComponent("minecraft:health") || !src?.damagingEntity) return;

    const attacker = src.damagingEntity;
    if (attacker.typeId !== "minecraft:player") return;

    const equippable = attacker.getComponent("minecraft:equippable");
    if (!equippable) return;

    const held = equippable.getEquipment(EquipmentSlot.Mainhand);
    if (!held) return;

    if (held.typeId === "finalwars:keizer_power") {
        forceDamage(victim, 7_500_000);
    }

    if (held.typeId === "finalwars:keizer_cross") {
        forceDamage(victim, 10_000_000);
    }
});```
#

And it did work! considering that method

#

This is the 2 items that included in the script:

    "format_version": "1.20.80",
    "minecraft:item": {
        "description": {
            "identifier": "finalwars:keizer_cross",
            "menu_category": {
                "category": "equipment"
            }
        },
        "components": {
            "minecraft:icon": "keizer_cross",
            "minecraft:allow_off_hand": true,
            "minecraft:max_stack_size": 1,
            "minecraft:damage": 10000000,
            "minecraft:hand_equipped": true,
            "minecraft:can_destroy_in_creative": false,
            "minecraft:display_name": {
                "value": "Keizer Cross\n\n§9+10000000 Attack Damage"
            }
        }
    }
}```
#
    "format_version": "1.20.80",
    "minecraft:item": {
        "description": {
            "identifier": "finalwars:keizer_power",
            "menu_category": {
                "category": "equipment"
            }
        },
        "components": {
            "minecraft:icon": "keizer_power",
            "minecraft:max_stack_size": 1,
            "minecraft:hand_equipped": true,
            "minecraft:damage": 7500000,
            "minecraft:can_destroy_in_creative": false,
            "minecraft:display_name": {
                "value": "Keizer Cross\n\n§9+7500000 Attack Damage"
            },
            "minecraft:allow_off_hand": true
        }
    }
}```
proper cove
#

@grizzled geyser so this works?

grizzled geyser
#

Yep, it does

proper cove
#

so your saying i could copy and paste it then change the identifier and it would work?