Hey. I'm trying to create a ranks voucher that will upgrade a player's rank when right-clicked. I got the rank upgrade and self destruction of the item part down, however I'm now struggling to implement a feature where a firework will explode when a player right clicks. The command I'm using that doesn't work to try to accomplish this is:
execute as {player} run summon firework_rocket ~ ~1 ~ {LifeTime:1,FireworksItem:{id:firework_rocket,Count:1,tag:{Fireworks:{Flight:1,Explosions:[{Type:1,Flicker:0,Trail:0,Colors:[I;3887386,4312372,15790320],FadeColors:[I;4312372,15790320]}]}}}}
I do not want to give players the permission to use summon commands so I must run it through console. How can I grab the location of the player through the console and summon a firework at that location?