War was outlawed in 1928
In this article from Scientific American, Michael Shermer points out that war was outlawed in 1928. I was pretty surprised — I’d never heard of this. But it’s true — it’s called the General Pact for the Renunciation of War, also known as the Kellogg–Briand Pact, and was originally signed by France, Germany, and the US and then by most other countries.
You might initially suppose that it didn’t work very well, but it might have been one of many things that contributed to the fact that after World War II there have been very few wars of conquest or interstate wars.