In a medium saucepan, whisk together the sugar, cocoa powder, cornstarch and salt so there are no lumps.
Slowly pour in the milk while whisking constantly until the mixture is completely smooth.
Cook over medium heat, whisking constantly, for 6 to 8 minutes until the pudding thickens and large bubbles begin to break the surface. Let it bubble for 1 full minute so the cornstarch activates.
Remove from the heat and stir in the chopped chocolate, butter and vanilla until melted and glossy.
Pour into 4 serving glasses, press plastic wrap directly onto the surface to prevent a skin, and chill for at least 3 hours. Top with whipped cream and chocolate shavings before serving.