How can I summon TNT without causing damage to blocks?

Solution 1:

Method #1:

On a fast Redstone clock / using Repeat Command blocks, put this command:

/execute @e[type=PrimedTnt] ~ ~ ~ summon Creeper ~ ~ ~ {powered:1}

Then, with a Comparator, execute this command to kill the TNT:

/kill @e[type=PrimedTnt]

Note: Before you do this, you would have to run this command:

/gamerule mobGriefing false

Method #2:

Repeatedly run these commands in Command blocks (repeat as fast as you can):

/execute @e[type=PrimedTnt] ~ ~ ~ summon ArmorStand ~ ~ ~ {CustomName:"RudolfJelinek"}

/execute @e[type=PrimedTnt] ~ ~ ~ setblock ~ ~ ~ minecraft:water

And when the Comaparator leading from one of the CMD blocks above does not output signal, execute these commands:

/execute @e[type=ArmorStand] ~ ~ ~ setblock ~ ~ ~ minecraft:air 

/kill @e[name=RudolfJelinek]

Solution 2:

Similar to Unionhawk's comment:

you should run three commands one after the other:

Do gamerule mobGriefing = false**

1 tick delay

Summon Creeper fuse 0 at Tnt

3 ticks delay

Do gamerule mobgriering = true