First, create the following folder
📂BP
└📄manifest.json
└📚pack_icon.png
└📂functions
└📄ingnite.mcfunction
Enter your command in ingnite.mcfunction
example: summon ender_crystal
Then enable the addon you created and use the block with ingnite.mcfunction.
And if you perform a certain action, you can execute the ingnite.mcfunction.