Trelawny was initially happy to have joined the navy and enjoyed the rough lifestyle there. He often exaggerated his age while he was in the navy. Some biographers believe he commanded a vessel as a midshipman in an engagement with the French at Mauritius in 1810. Some also believe that he was wounded engaging the French in Java in August 1811. He left the Navy in 1812 at the age of 19; receiving a final settlement of pay in 1815. He had grown to resent the discipline of the Navy due in part to the frequent punishment that he experienced. He was often sent to the masthead for several hours at a time. During that time, he frequently entertained fantasies of mutiny and desertion. Some biographers believe that Trelawny was inspired by hearing accounts of the French pirate Robert Surcouf. He was never commissioned as a lieutenant, though many of his contemporaries were. This disappointed him, although he began referring to himself as Lieutenant Trelawny anyway.