I have a datapack in which a gun can be reloaded automatically when mag is emptied.

There is a reload.mcfunction that would set the ammo value of the current player to full.

What I want to do is, when the magazine is emptied, I schedule the reload function to reload after 4 seconds. What I did is this. schedule function namespace:gun/reload 4s However, after 4 seconds nothing happened. I am confused as to how the schedule function works in general even after checking the wiki page and I can't get the command to work even once.

I even tried this - in a kill.mcfunction I wrote kill @s

/execute as PlayerName run schedule function namespace:kill 1t

Still, I am intact after a tick. Can someone help provide a clear syntax of the /schedule command and tell me if I did anything wrong?

1 Answer 1


I got it, scheduled functions are not performed by the initiator of the function scheduled, but the system is responsible. Therefore writing kill @s would not do anything for the system will not kill itself. I changed it to kill @a and the function worked.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .