It is not yet updated to the latest version of Minecraft (currently still on 1.6.2) but Single Player Commands basically takes a lot of cheaty commands and adds them in single-player mode.
If you install this, use the command /health infinite
You now get 'hit' as normal, can be killed by insta-death effects like falling into the Void, but otherwise have infinite HP.
For 1.7.9 there is MrChris' GodMode mode which does much the same thing.
I can't do it with loot tables, but I can still help you. Get a repeating command block and input:
/scoreboard objectives add test stat.killEntity.WitherSkeleton
Next, in the same direction as that command block is facing, place a chain command block and input this:
execute @p[score_test_min=1] ~ ~ ~ summon minecraft:wither_skull ~ ~ ~
which is good if your inventory is filling up fast, or
give @p[score_test_min=1] minecraft:skull 1 1
which is great if you're on a server and don't want people pinching your skulls. Next place another chain command block with:
/scoreboard players set @p[score_test_min=1] test 0
Note: Replace 'test' with the name of a scoreboard of your choosing, set the repeating command block to always active and unconditional, set the others to always active and conditional. This is multiplayer-friendly.
Bonus: If you use this for something more common (like cows and leather, for example), you might want to limit the availability by imposing a second requirement. To do this, put another repeating command block in place. Whichever repeating command block is closest to the chain command blocks can be a chain command block, but it must be set to conditional.
An example of a different kind of restriction is:
{SelectedItem:{id:minecraft:iron_axe,tag:{display:{Name:"Sacrificial Axe"}}}}
Best of luck!
Best Answer
First summon a Zombie with a tag:
Then summon an armor stand that is invisible, has no gravity, and is a marker, that as well has a tag:
In a repeating command block tp the armorstand to the tagged zombie:
Then for the tnt part.
You need a repeating command block that is powered by a Redstone block next to it with the command:
After this block there should be a chain block that will summon the tnt, this block should be
chain
,conditional
, andalways active
:The first
execute
command executes only if there are no entities with the tag: zo, then removes its source block. The second executes only if the first one succeeds and summons tnt at the location of the armor stand. You can add an additionalconditional
command block afterward to remove the armor stand. And whensummoning
the two entities you can put that in a command blockchain as well, here you could add the Redstone block that activates the execute command chain.