This has been my big project in the recent past. I had the idea that player replays could be stored by simply capturing and replaying the packets sent by a player client, and the benefits would be innumerable. I was fascinated with this idea and prototyped it (sadly I learned that Hypixel released the exact same thing the day before I came up with the idea :( ).
The details of the system are enumerated in this forum post. The video demo included in it is below.