A registered sex offender allegedly defied a ban on contact with children by attending a baby shower event, the High Court heard today.