How do I summon a fireball with a specific explosion power in a dispenser?
/summon minecraft:fireball ~ ~ ~ {ExplosionPower:200}
I know how to summon one with commands, but I don't know how to make this shoot out of a dispenser.
I think a better way would be to do something to the effect of:
execute as @e[type=fireball] if block ~-1 ~ ~ dispenser run data merge entity @s {ExplosionPower:200}
Note: I have not tested this but it should be close.
You will need 4 of this command to check the cardinal directions (and perhaps 2 more if you want to fire it up or down), but this will merge whatever explosion power value you want with any fireball directly next to a dispenser. The only downside is it has no way of knowing whether it was shot out of that dispenser or not, so it would affect other fireballs that happen to fly by it.
Use a command block to summon the fireball right in front of the dispenser, and the motion tag to set it moving. You can attach any redstone mechanisms you would attach to the dispenser to the command block.
To summon a fireball that has an Explosion Power of 4 and moves East at an initial velocity of 3.0: (starting in 1.16, use the Motion NBT tag to set initial velocity instead of the direction tag)
/summon fireball ~ ~1 ~ {ExplosionPower:4,Motion:[3.0,0.0,0.0]}