Place the pineapple, star anise, caster sugar, rum and vanilla bean and seeds in a heavy-based frying pan over medium heat and cook, stirring occasionally, for 8 minutes or until the pineapple has caramelised. Set aside to cool to room temperature. Remove and discard the star anise and vanilla bean.