#Unable to apply effects on enemies when using custom sword data
1 messages · Page 1 of 1 (latest)
<@&1201956957406109788>
💬 While you wait, take this time to provide more context and details.
🙇 If nobody has answered you by <t:1736506096: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
these are the errors I currently have
[{
"resource": "/c:/Users/willb/AppData/Roaming/.minecraft/saves/New World (1)/datapacks/heros_weapons/data/heros_weapons/advancement/deal_damage.json",
"owner": "generated_diagnostic_collection_name#2",
"severity": 4,
"message": "Cannot find function “heros_weapons:deal_damage” (rule: undeclaredSymbol)",
"source": "spyglassmc(1.21.4)",
"startLineNumber": 8,
"startColumn": 22,
"endLineNumber": 8,
"endColumn": 47
},{
"resource": "/c:/Users/willb/AppData/Roaming/.minecraft/saves/New World (1)/datapacks/heros_weapons/data/heros_weapons/predicate/holding_item/legendary_wither_sword.json",
"owner": "generated_diagnostic_collection_name#2",
"severity": 4,
"message": "Unknown key “equiptment”",
"source": "spyglassmc(1.21.4)",
"startLineNumber": 5,
"startColumn": 9,
"endLineNumber": 5,
"endColumn": 21
}]
How are you currently applying the effect?
Im not sure how all this works tbh I'm new to coding and have been doing this to learn but heres one of the spots I think it could be
tag @s add attacker
advancement revoke @s only heros_weapons:deal_damage
#Legendary Wither Sword
execute if predicate heros_weapons:holding_item/legendary_wither_sword as @e[type=#heros_weapons:mobs, distance=..10, nbt={HurtTime:10s}, tag=!attacker] at @s run function heros_weapons:swords/legendary_wither_sword
tag @s remove attacker
and heres the effects file
Ok I would use an enchantment instead
Handles abilities for Legendary Wither Sword
particle campfire_signal_smoke ~ ~1 ~ 0 0 0 0.02 30 force
playsound entity.wither.death master @a ~ ~ ~ 1 1
effect give @s slowness 5 2 true
Tagging entity with legendary_wither_sword
tag @s add Hit_by_legendary_wither_sword
is there an enchantment that applies slowness on a player?
I saw bane of arthropods but that didn't end up working
You would make a custom enchantment
and for the sound and particle effects?
what would I do for those?
You would probably make the enchantment run a function which did those
Actually no, you can do both with enchantments
kk
I'll look into this
thanks! 🙂
last question tho is there a way to make an enchantment invisible to other players?
What do you mean by other players?
like not viewable at all I mean
just is on the weapon
but not able to be seen
?
You can disable all enchantments, but not individual ones, unfortunately
dang :/
aight
I'll just leave it as visible
thanks anyways! 🙂