During the reign of Emperor Gaozong of the Southern Song, Wang, the wife of Li Maochun from Tiantai County, Zhejiang, gave birth to a son. The boy was a reincarnation of the Purple-Gold Arhat, and Elder Xingkong of Guoqing Temple on Mount Tiantai named him Xiuyuan. When Li Xiuyuan was eighteen, his parents died one after the other. He went to Lingyin Temple in Lin'an to become a monk, taking Elder Yuanyan of the Hall of the Blind as his master and receiving the Dharma name Daoji.
Daoji often fell asleep while meditating and toppled off his meditation platform. He also refused to abstain from alcohol and meat, and liked to wander around singing folk songs. The monastery's supervising monk beat him for this time and again and threatened to drive him out. The elder said, "The Chan school is vast. Surely it can make room for one mad monk?" From then on, everyone called him "Mad Daoji," later shortened to "Jidian." Since the character for madness is interchangeable with the one meaning topsy-turvy, he is also known as Jidian.