#Making enchantment effect stronger

1 messages · Page 1 of 1 (latest)

glacial helm
#

Im trying to make an enchantment for swords and axes that give the wither effect, but im not sure how to scale the effects with the enchantments level, this is the code

{
"description": "Withering",
"exclusive_set": "minecraft:fire_aspect",
"supported_items": [
"minecraft:wooden_sword",
"minecraft:stone_sword",
"minecraft:golden_sword",
"minecraft:iron_sword",
"minecraft:diamond_sword",
"minecraft:netherite_sword",
"minecraft:wooden_axe",
"minecraft:stone_axe",
"minecraft:golden_axe",
"minecraft:iron_axe",
"minecraft:diamond_axe",
"minecraft:netherite_axe"
],
"weight": 15,
"max_level": 3,
"min_cost": {
"base": 10,
"per_level_above_first": 10
},
"max_cost": {
"base": 25,
"per_level_above_first": 10
},
"anvil_cost": 7,
"slots": [
"mainhand"
],
"effects": {
"minecraft:post_attack": [
{
"effect": {
"type": "minecraft:run_function",
"function": "wither"
},
"enchanted": "attacker",
"affected": "victim"
}
]
}
}

the function wither applies the wither effect to the entity:
effect give @s wither 10

strong raptorBOT
#

<@&1201956957406109788>

Someone will come and help soon!

💬 While you wait, take this time to provide more context and details.

🙇 If nobody has answered you by <t:1735668495:t>, feel free to use the Summon Helpers button to ping our helper team.

✅ Once your question has been resolved (or you no longer need it), please click Resolve Question or run /resolve

dusk copper
#

Don't run a function, you can just add an apply mob effect component to the post attack effect

#

And that'll let you set the duration and amplifier based on enchantment level

glacial helm
#

{
"description": "Withering",
"exclusive_set": "minecraft:fire_aspect",
"supported_items": "#minecraft:enchantable/sharp_weapon",
"primary_items": "#minecraft:swords",
"weight": 15,
"max_level": 3,
"min_cost": {
"base": 15,
"per_level_above_first": 10
},
"max_cost": {
"base": 25,
"per_level_above_first": 10
},
"anvil_cost": 7,
"slots": [
"mainhand"
],
"effects": {
"minecraft:post_attack": [
{
"effect": {
"type": "minecraft:apply_mob_effect",
"to_apply": "minecraft:wither",
"min_duration": 10,
"max_duration": 15,
"min_amplifier": 0,
"max_amplifier": 2
},
"enchanted": "attacker",
"affected": "victim"
}
]
}
}

#

like this?

#

YAY IT WORKS

#

THANKS