How do you make people drop extra items on death?

As seen in this video: (Skip to 5:53)


When a player is slain, they drop an Enchanting Table on top of their inventory.

How was this achieved and how can I build a system (using command blocks) that does that?
Come to think of it, what happens to a player's location when he/she dies? Does it reset to the spawnpoint? Stay the same (where they died) until they respawn? Or becomes a null value until they respawn?


Solution 1:

  1. Make a scoreboard objective of stat.deaths for example called death using /scoreboard objectives add death stat.deaths deaths.

  2. Run a clock on a commandblock with the command /excecute @a[score_death_min = 1] summon item ~ ~ ~ {Item:{id:minecraft:enchanting_table}}

  3. Run another commandblock after the previous one with /scoreboard set @a[score_death_min = 1] death 0