3

I want to be able to summon a baby zombie that has a TNT block on its head. The command I have so far is

/summon Zombie ~ ~1 ~ {IsVillager:0,IsBaby:1,Equipment:[{},{},{},{},     {id:tnt,Count:1}],DropChances:[0.085F,0.085F,0.085F,0.085F,0.0F],Attributes: [{Name:generic.maxHealth,Base:8},{Name:generic.attackDamage,Base:0}]}

However, is there any way to prime that TNT? Im guessing that this would not have anything to do with setting a block over the zombies head, but I do want that for aesthetic value -- and to let the player know the zombie is probably going to blow up.

When doing a little research on the subject before coming here, I came across summoning the TNT at the zombies with a fuse of 0 (zero). For me I don't think that this would work, because the TNT would still not stay with/on the zombie, and would just blow up where it was summoned (killing the zombie in the process most likely. Perhaps there is a way to summon the primedTNT when the baby (summoned with the command above) came with one block of the player? If so this also needs to instantly kill the zombie. Any ideas are welcome.

2
  • I don't know much about MC Commands, but I found this: minecraftforum.net/forums/minecraft-discussion/…
    – user37332
    Commented Jan 13, 2016 at 6:53
  • 1
    Basically, primed TNT has a "fuse" property that you need to apply like on the forum.
    – user37332
    Commented Jan 13, 2016 at 7:41

2 Answers 2

3

You can't ignite the TNT in the Zombie's head slot, but you can use the Passengers tag to summon the Zombie with PrimedTnt riding it.

Example:

/summon Zombie ~ ~ ~5 {Passengers:[{id:"PrimedTnt", tag:{Fuse:100}}]}  

Since the Passengers tag is only really a flag that the /summon command looks for, /entitydata and similar commands won't be able to place a PrimedTnt on the Zombie. This means that if you want a PrimedTnt entity on the Zombie, the only real practical solution is to summon him with the TNT.

If you want a proximity trigger, you could summon a PrimedTnt with a fuse time of 0 at Zombies near Players.

Example:

/execute @e[type=Player] ~ ~ ~ execute @e[type=Zombie,r=1]  ~ ~ ~ summon PrimedTnt ~ ~ ~ {Fuse:0}  

We use @e[type=Player] instead of @a to avoid targeting dead players: we likely don't want a Zombie to explode because it's trying to walk over a corpse.

2
  • Is this in 1.9 only? Or is it compatible with 1.8.8? Commented Jan 14, 2016 at 1:28
  • With 1.8.8, you would need to use the Riding tag instead of the Passengers tag. Instead of summoning a Zombie with a PrimedTNT as a passenger, you need to summon a PrimedTNT riding a Zombie. Example: /summon PrimedTNT ~ ~ ~5 {Fuse:100, Riding:{id:"Zombie"}} I don't recommend using this, though, as it is deprecated and will not work in 1.9 or any future versions. Commented Jan 14, 2016 at 1:57
1

To accurately set the position of the TNT summon it with this command:

/summon PrimedTNT ~ ~ ~ {Fuse:NUMBER,CustomName:"NAME"}

or

/execute @e[type=Zombie] ~ ~ ~ summon PrimedTNT ~ ~ ~ {Fuse:NUMBER,CustomName:"NAME"}

with NUMBER replaced by a number, and NAME replaced by a name of your choice.

If you have more than one zombie in the world, and don't want ALL of them to have the TNT, then give the baby zombie a custom name (eg. TNTZombie), and use it in a selector.

Then place a |repeat|unconditional|always active| command block with this command:

/tp @e[name=NAME] @e[name=TNTZombie]

In relation to the idea of the "near player" activated aspect, the TNT-summoning command would have to be linked to a |repeat|unconditional|always active| command block with a command like this:

/execute @e[name=TNTZombie] ~ ~ ~ testfor @a[r=1]

Then connect that to a comparator, which will give some delay before activating a |impulse|unconditional|needs redstone| command block with this:

/execute @e[name=TNTZombie] ~ ~ ~ summon PrimedTNT ~ ~ ~ {Fuse:NUMBER}

This system activates the zombie summoning the TNT only once. If the explosion somehow doesn't kill the zombie, use a chain command block attached to the previous command block with this command:

/kill @e[name=TNTZombie]

Have fun with those exploding zombies!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.