I would guess that if China attacked a US ship - or Taiwan - the following three things would happen:
1. All trade with China and the US would cease.
2. All Chinese assets in the US would be seized.
3. A US naval blockade (at a distance) would cripple the Chinese economy.
Is China willing to accept all that?
IIRC, there are many microchips used by our military that are only made in China. Trump saw the insanity of that and tried to rectify it. Did he succeed?