As Jack ran around the corner of the brig and hid, he had a brilliant plan come to mind that he would find the thump-thump, stab it, and put an end to this bloody madness. Jack honestly didn't have any qualms about becoming captain of the ship at this point considering his ship had sunk by one of the most unlikely ways possible in his mind which was burning rum. Never in his wildest dreams did he think his ship would burn that way because he liked no wait he actually loved rum and it was an absolutely crazy idea to him that was how it would sink a second time. As he came back to his senses, he was thinking I have to get off this ship, before anyone finds out as much as I have in the past few days. So Jack ran to the rail of the ship without anyone catching him and jumped overboard. After jumping overboard he started to breathe underwater and thought to himself this is weird, this has never happened before, when he felt someone shaking his body and he woke up in his bunk, in his cabin on the Black Pearl.
At that Jack felt ecstatic and started to run around like a child towards the rum leaving Gibbs behind and started to drink three bottles of rum at the same time nonstop. After he finished his rum and felt the pearls mast to make sure it was real. He had figured it out that all the adventures he just had was just a crazy messed up dream.