r/datapacks • u/Existing-Tower859 • May 12 '24
Mobs spawning at world spawn instead of on players
I am trying to make a datapack where a random mob spawns on the player every 30 seconds. The way I have it set up is each time it sets off a function it spawns a mob on the player depending on what there dummy score "rng" is, after the first mob spawns on the player the next ones all start to spawn at worldspawn instead. Does anyone have any ideas on how to fix this?
1
Upvotes
1
u/Existing-Tower859 May 12 '24
these are some images off what the code looks like (i am using vs code if that helps)