#Custom Item/Weapon Damage
1 messages · Page 1 of 1 (latest)
I would use custom components to detect on hit entity then apply the additional damage.
The json only supports 255 due to a bug where anything over it uses the modulus operation.
Never heard from that thing you said about modulus operation and but I found a better way to produce such higher values by using scripts to override the damage value
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
}
}
}```
@grizzled geyser so this works?
Yep, it does
so your saying i could copy and paste it then change the identifier and it would work?