The IC isn't good at it when members dilute the agreements they're a party to, like China and India are doing in this case. The Charter clearly proscribes all members, including the major powers, from non-defensive war. That the Charter also puts the power to use force in the hands of the five permanent members of the Security Council does provide a loophole for e.g. Russia, to not hold itself accountable for having illegally started a war.
That's not the case with all agreements though. NATO's charter requires conformance to the UN Charter, but has an automatic defense clause that requires use of force if any member is attacked. Should it be true any member attacks another, the attacking member is (a) automatically outside the bounds of the NATO and UN charters (b) article 5 still applies, the other member states are obligated to militarily defend the member(s) attacked. There's no allowance for the sabotage found in the UN Charter by way of Russia vetoing action against its aggression.