War is illegal under the international law for all UN member states. The main exceptions are self defense or when authorized by the UN Security Council.

Of course, nobody really cares about that.

Was the idea here that because the UN declares that war is illegal, that no country will do war anymore?

I mean, wtf.

After WW1 and WW2 and with the threat of nuclear war, people were willing to try any amount of talking as a less horrific option.