Primed TNT on summoned mobs
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.
Best Answer
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.
Pictures about "Primed TNT on summoned mobs"



How do you summon TNT on mobs?
NameIdentifierTranslation keyPrimed TNTtntentity.minecraft.tntWhat is the entity name for primed TNT?
The command to summon primed tnt in 1.12.2 is: /summon tnt <x> <y> <z> You could also add data tag Fuse to increase the fused time: /summon tnt <x> <y> <z> {Fuse:80}MC TUTORIAL - SUMMONING PRIMED TNTs!
More answers regarding primed TNT on summoned mobs
Answer 2
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!
Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.
Images: Pew Nguyen, Anna Tarazevich, Susanne Jutzeler, suju-foto, Nothing Ahead
