Jedi (player monster)
Most player monsters are never randomly generated (except in variants which enable random generation of player monsters) and only appear on the Astral Plane (or, in SLASH'EM and variants, the Guild of Disgruntled Adventurers), or if the player reads a cursed scroll of genocide while confused, uses undead turning on the corpse of one (found in the Valley of the Dead or a bones level), or casts stone to flesh on a statue of one found on Medusa's Island.
The Jedi role is unusual in that a number of peaceful player monsters are guaranteed to appear on several levels of the quest, where they will join the player in fighting the stormtroopers and Lord Sidious. NPC Jedi (and, on the home level, padawan) will attack stormtroopers and even Lord Sidious on sight. In return, stormtroopers and Lord Sidious will attack Jedi, when they are not attacking you.
If the Guild of Disgruntled Adventurers is generated, a hostile Jedi will appear, along with a hostile padawan.
Reference: Benjamin Schieder's Jedi Patch