4

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?

2
  • I believe if you set MobGriefing to false, it will make ghast fireballs not set fire. If this doesn't work or you can't use mobgriefing I can write up another workaround later Sep 25, 2015 at 14:16
  • 2
    Setting MobGriefing to false does work, but also cancels out the explosion, so you might as well just set the ExplosionPower to 0, still causing damage to players/mobs. Then again, by turning MobGriefing off, you can set the power of the fireball as high as you want.
    – thezi3
    Oct 1, 2015 at 13:20

1 Answer 1

5

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.

4
  • 2
    While the content seems good, the formatting on this is pretty hard to read. Could you have a go at making it more of a step-by-step than a wall of stripy text/commands? :)
    – DBS
    Nov 28, 2015 at 18:28
  • Ok, going to edit that in. Nov 28, 2015 at 18:48
  • 1
    @deprilula28 I reformatted your answer quite a bit, and made changes to the commands. There were some capitalization mistakes with the score_[name] selectors, and you need c=1 on several of the commands. Also, your final command (setting C to 0) can't run on execute, since the FireBall doesn't exist any more. The general method is good though.
    – MrLemon
    Nov 28, 2015 at 20:00
  • Thanks! English isn't my main language, thankful someone helped me formatting. Good note on the last command also. Nov 28, 2015 at 20:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .