The Monkey King is Sentenced to Death
After fighting his way through Di Yu (地狱 dì yù) and erasing his name (as well as the name of as many of his monkey disciples he could find) from the Book of Life and Death (生死簿 shēng sǐ bù), the Monkey King (孙悟空 sūn wù kōng) had once again made himself immortal - many times over by this point. News of his disruptive behaviour reached the Jade Emperor (玉帝 yù dì) who by now had a long list of complaints about the monkey to deal with. He initially wanted to arrest the Monkey King but one of his advisors suggested that "instead of trying to take him by force...why not offer him a lowly position in Heaven so we can keep a close eye on him and discipline as necessary?" To which the Jade Emperor agreed.
And so, the Monkey King was brought to Heaven and given the title of Horse Master (弼马温 bì mǎ wēn), and all was good. Until he found out that it was the lowest rank in the whole of Heaven, then he fought his way through the guards and back down to earth where he rejoined his monkey army on the Mountain of Flowers and Fruit (花果山 Huā guǒ shān) and declared himself the "Great Sage, Heaven's Equal" (齐天大圣 qí tiān dà shèng).
The Jade Emperor then sent some of his strongest soldiers to bring the Monkey King back to Heaven to be disciplined but he defeated each and every one of them. He insisted that he will only return if the Jade Emperor gave him a better title.
Before the Jade Emperor could send another wave of soldiers to their defeat, his advisor once again suggested a less forceful strategy: "Why not just agree to this 'empty title'? Give him what he wants so he stops causing trouble." To which the Jade Emperor agreed.
So the Monkey King returned to Heaven and was officially granted the title "Great Sage, Heaven's Equal," but since there are no responsibilities tied to the title, the Jade Emperor worried that the Monkey King would soon grow bored and start causing havoc again. To keep him occupied, they assigned him to guard the Flat Peach Garden (蟠桃园 pán táo yuán), a garden full of peach trees that only bear fruit once every few thousand years, but not just any fruit, the Peaches of Immortality (仙桃 xiān táo) - in retrospect, not the smartest job to give a monkey.
After a short while, the Monkey King could no longer control his impulses, he went tree to tree and ate the Peaches of Immortality until all the trees were bare. However, before his crimes were brought to light, the Monkey King learned that a banquet was about to take place, a banquet that he was not invited to. So he abandoned his post, transformed himself into another deity and walked straight in. When he arrived at the banquet hall, he was immediately enticed by the smell of wine, so he stole the entire supply and proceeded to drink it all. (Both the peaches and the wine impart immortality onto the consumer, so by this point, the Monkey King was well and truly immortal!)
In a drunken confusion, the Monkey King searched for a place to rest and found himself in Tai Shang Lao Jun's quarters. As he stumbled through he came across Tai Shang Lao Jun's alchemy lab where he discovered gourds full of Pills of Immortality (仙丹 xiān dān). No surprises here, the Monkey King decided to eat them all before abruptly sobering up and realising what he had done. In a panic, he fled back to the Mountain of Flowers and Fruit to be with his people.
Furious, the Jade Emperor dispatched the vast majority of his Heavenly army to apprehend the Monkey King, however, by this point, none of his soldiers were a match for him. They fell one-by-one until finally the Jade Emperor sent Er Lang Shen (二郎神 èr láng shén) - a God with a third truth-seeing eye in the middle of his forehead (天眼 tiān yǎn) - to finish the job. As the Monkey King and Er Lang Shen met in battle, Er Lang Shen transformed into a giant monsterous form, and not to be out beaten, the Monkey King followed suit.
When his army saw what the Monkey King had turned into, they fled the battlefield in fear of their leader. Disheartened, the Monkey King lost the will to fight, transformed into a bird, and flew away. Er Lang Shen used his third eye and saw through the Monkey King's deception. The two once again met in battle when suddenly the Monkey King found himself caught in magical snare by Tai Shang Lao Jun.
Tai Shang Lao Jun took the Monkey King back to Heaven to be executed, however, given how immortal he had made himself, none of their weapons were able to penetrate his skin. The Jade Emperor was at a loss. Then, Tai Shang Lao Jun had an idea; if they placed the Monkey King in his Brazier of Eight Trigrams, they could separate the ellixir - which at this point had formed a single solid mass in his stomach - weaken his body, then execute him. And so they tried. But monkeys are cunning little creatures.
Realising the nature of the brazier, the Monkey King climbed into the Wind compartment (☴), for where there is wind, there can be no fire. However, he could not escape the smoke. And after 49 days, when Tai Shang Lao Jun opened the brazier, expecting to find a pile of monkey ashes, out jumped a livid Monkey King with red eyes that burned like fire, who promtly pushed Tai Shang Lao Jun over with ease and fled the scene unscathed.