If-then system in functions
Hi! The overall goal of my datapack is to be able change things about the game when certain advancements are gotten. For example, when the player gets the "cover me in diamonds" advancement, mobs will spawn with diamond armor more frequently. Basically, this:
if (var=0) then spawn hostile mobs with normal (vanilla) gear if (var=1) then spawn hostile mobs with diamond gear more oftenSo here's my question:
(How) can I make it so that a function (or a certain command in a function) is run only when an advancement has been gotten? Or some condition is met. Sorry if that doesn't make sense lol.
Also, is there a way to change the armor that mobs spawn with with a datapack? I couldn't seem to find a way to spawn mobs with items, only give them to them once they've spawned, which could create issues in the pack.
Apologies if any of this doesn't make sense, I'm pretty tired rn. Lmk if you need more details on anything, idek if this is possible, or easy to do/explain