How can I prevent fireballs from setting fire?

I was wondering if you are able to summon a fireball that has ExplosionPower
, and thus does damage to players/mobs, but does not set fire to blocks.
To summon the fireball I use:
/summon Fireball ~1 ~1 ~1 {direction:[0.0,0.0,0.0],ExplosionPower:3}
.
I found something like event.setFire(false)
, but how can I add this to the summon command?
Best Answer
The example you gave at event.setFire(false)
is used in Event inside the Spigot API (Plugin programming). This solution is more eligible in terms of Vanilla.
First, create two dummy
-type scoreboard objectives. For this example, let's call them "A" and "C":
scoreboard objectives add A dummy
scoreboard objectives add C dummy
On a 20 Hz clock, run these commands in this order:
execute @e[score_A_min=0,type=FireBall] ~ ~ ~ summon ArmorStand ~ ~ ~ {DisplayName:"B", DisplayNameVisible:false}
scoreboard players set @e[type=FireBall,score_A=0] A 1
tp @e[type=ArmorStand,name=B,c=1] @e[score_A_min=1]
execute @e[type=FireBall] ~ ~ ~ scoreboard players set @e[type=ArmorStand,name=B,c=1,r=0] C 1
execute @e[type=ArmorStand,name=B,score_C=0] ~ ~ ~ fill ~-6 ~-6 ~-6 ~6 ~6 ~6 air 0 replace fire
kill @e[type=ArmorStand,name=B,score_C=0]
scoreboard players set @e[type=ArmorStand,name=B] C 0
To track down the FireBall's location, we summon an ArmorStand with no HitBox, and set his name to anything. For this answer, we'll call it "B" (Name will not be shown). After the summon, we set the FireBall's A score to 1, and will teleport the ArmorStand to it every tick.
Execute as the FireBall to set the closest ArmorStand's C score to 1.
Let's make any ArmorStand with 0 score of C to transform nearby fire to air, since that would mean that the FireBall is dead (exploded). Aftward, we kill the ArmorStand. In order to that work, we also will have to set all the ArmorStands to 0 at the end.
Pictures about "How can I prevent fireballs from setting fire?"



Quick Answer about "How can I prevent fireballs from setting fire?"
How much damage does a fireball do in Minecraft?
A fireball, if deflected by the player, deals 1000 damage to a ghast.How do fireballs spawn?
How to Enter the CommandPro Tip: How To Keep Fire Balls On The Hook In Fast Water
Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.
Images: Jill Burrow, Alena Shekhovtcova, Tara Winstead, Alena Shekhovtcova