All luggage is x-rayed. If they see what looks like an obvious bottle of liquor they will open the bag and inspect it.
For example Carnival allows a bottle of wine per adult, so if they see a bottle they will inspect it to make sure it is not something other than wine. If it is tequila they will take it away for the length of the cruise.
I believe Carnival still allows 1 12-pack of water or soda. Royal/Celebrity do not allow any drinks brought onboard.
I started a new practice which I cannot believe I never thought of before - buy one large bottle of water ($4.00 at the bar) and for the rest of the cruise refill it at the buffet with filtered water. Why not?