Ship trajectory prediction is crucial for intelligent navigation applications, especially in the field of simulation of the flow of traffic on ships. Traditional models face limitations due to environmental uncertainty and the impact of collaborative ship behavior on trajectories. Long-term predictions suffer from accumulated errors, leading to reduced accuracy. A new multi-ship trajectory prediction model called ShipVAE is proposed based on variational autoencoder principles. ShipVAE, an extension of the pedestrian model SocialVAE, improves network structure, collision avoidance loss, and adds navigation mark information to enhance trajectory consistency with actual ship navigation. Experiments in the #49 red buoy areas of Fujiangsha water region on an AIS-based ship dataset reveal a 15% reduction in ADE and a 13% reduction in FDE compared to the baseline SocialVAE model.