Of course this isn't really automatic and triggered by the smallest thing, both sides kind of have to "agree" to be at war, e.g. by a counter-attack, a declaration following the attack or something like that. And nobody really wants to take that bait, due to the huge consequences involved.
Yet, it is China playing with fire here, we all can be happy that none of the affected nations took them up on their "offer" of war.
They can later claim that the crew and captain acted on their own will, without orders from the Chinese leadership. They can duly punish the captain and crew or disavow the vessel and declare them renegade, disallow them to fly their flag. But without such a declaration, a nation such as China is responsible for the conduct of their fleets, be they civilian or military. And any vessel they allow to fly their flag is part of their (in this case civilian) fleet.
https://en.wikipedia.org/wiki/Flag_of_convenience
> A ship's flag state exercises regulatory control over the vessel and is required to inspect it regularly, certify the ship's equipment and crew, and issue safety and pollution prevention documents.
Because US law is strong in this regard, the US military is by far the largest contributor to the count. Less than 200 civilian vessels are flagged in the US; https://www.statista.com/statistics/652126/us-flag-oceangoin....