mojira.dev
MC-241835

Tick Function Tag Doesn't Loop

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

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

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)

I know this is not the place to get support for custom functions. It's just that I thought it was a bug.

Austin Dean Koke

(Unassigned)

Unconfirmed

(Unassigned)

1.18 Pre-release 4

Retrieved