The young eunuch eventually became a trusted adviser to the prince and assisted him when the Jianwen Emperor's hostility to his uncle's feudal bases prompted the 1399–1402 Jingnan Campaign which ended with the emperor's apparent death and the ascension of the Zhu Di, Prince of Yan, as the Yongle Emperor. In 1393, the Crown Prince had died, thus the deceased prince's son became the new heir apparent. By the time the emperor died (24 June 1398), the Prince of Qin and the Prince of Jin had perished, which left Zhu Di, the Prince of Yan, as the eldest surviving son of the emperor. However, Zhu Di's nephew succeeded the imperial throne as the Jianwen Emperor. In 1398, he issued a policy known as xuēfān, or "reducing the feudatories", which entails eliminating all the princes by stripping their power and military forces. In August 1399, Zhu Di openly rebelled against his nephew. In 1399, Ma He successfully defended Beiping's city reservoir Zhenglunba against the imperial armies. In January 1402, Zhu Di began with his military campaign to capture the imperial capital Nanjing. Zheng He would be one of his commanders during this campaign.