Scholz's comments came a day after his visit to the world's second-biggest economy alongside German corporate CEOs, the first by a G7 leader since the COVID-19 pandemic.
"Because the Chinese government, the president and I were able to declare that no nuclear weapons should be used in this war, that alone made the whole trip worthwhile," Scholz said during an event of his Social Democratic party.
Xi, who secured a third leadership term two weeks ago, agreed that both leaders "jointly oppose the use or threat of use of nuclear weapons" over Ukraine, but refrained from criticising Russia or calling on Moscow to withdraw its troops.
Scholz, who has been criticised for seeming to continue a strategy that exposes Germany's economy excessively to China, its most important trading partner, said diversifying was key to limit possible repercussions should the relationship sour.
"We have a clear plan, and we are following it through. And that means diversifying for all the countries we trade with, especially, of course, a country that is so big and has such a large share of the world economy," Scholz said.
"We will continue economic exchange with China ... But it's also clear, we're going to position ourselves to be able to deal with a situation at any time where there are difficulties - whether it's 10 years from now or 30 years."
During his trip Scholz told business leaders, including the CEOs of Deutsche Bank (DBKGn.DE), Volkswagen (VOWG_p.DE), BASF (BASFn.DE), Siemens (SIEGn.DE), BMW (BMWG.DE), Merck (MRCG.DE) and BioNTech (22UAy.DE), to not put diversification on the backburner, a delegation source said.
At the closed-door meeting, he said it would take around 10-15 years to completely de-risk.
A separate government source said the impression was that the message had sunk in and that companies were diversifying while developing China ties.
This is particularly key for Germany's carmakers active in China, the world's top market, including Volkswagen, which has repeatedly been slammed for its plant in the Xinjiang region given reports of human rights violations there.
Battery materials, which are needed for packs that power electric vehicles, are also in focus. German automakers depend on China for lithium, nickel and cobalt, while Europe has launched programmes to build its own supply but is not there yet.
Germany's business relationship with China has come under closer scrutiny since February when Russia invaded Ukraine, which led to the end of a decade-long energy relationship with Moscow and caused numerous companies to ditch their local businesses.
This has fuelled concerns over the potential consequences for Germany's economy should China invade Taiwan.
"Start now, don't put it on the back burner. Do it now," Scholz said at a party event in comments which appeared directed at business leaders regarding diversification.