Setting an entry slug from a pluign
If you set the slug directly on the entry element, it should work!

public function init() {
    craft()-&gt;on('entries.saveEntry', function(Event $event) {
        $entry = $event-&gt;params['entry'];
        $entryId = $entry-&gt;id;

        $newTitle = str_replace('Name: ', $entryId . ' - ', $entry-&gt;title);

        $entry-&gt;getContent()-&gt;title = $newTitle;

        $entry-&gt;slug = $entryId;

        craft()-&gt;elements-&gt;saveElement($entry);
    });
}