With my data-pack: "
[media]", when I held my golden sword with my main-hand, the sword didn't get enchanted with sharpness level 1000. The functions are still able to run but just that the "#minecraft:tick" function isn't looping.
Attachments
Comments 3
I was investigating this a bit and was confused as well at first. The underlying issue is that for each of the targets of the /item
command (@e
in your original command), it applies the item modifier, but with the context of the calling function (nothing/world spawn in your case).
A fix would be to use execute as @e run item modify entity @s weapon.mainhand sword_with_sharp:sword
(notice the second @s
)
Your functions are setup incorrectly. This is not the place to get support for your custom functions. Please verify in places where the community provide support for this kind of thing, like /r/MinecraftCommands.
For this time: The server/world is executing the item command. If you executed it as a player, it would work:
execute as @a at @s run item modify entity @e weapon.mainhand sword_with_sharp:sword