Programming a stun grenade in Minecraft?

Di
1

Aye people,

my question is, how do I program a stun grenade in Minecraft?

I was already thinking of giving players a glare in a certain radius, just how can I program so that when my thrown object explodes, the players are blinded in a radius.

Ul

You query the distance to the explosion center, there's a suitable method in location, then you set your desired effect for those who are close enough.