I'm currently building a large amusement park in Minecraft and now I wanted to create wagons for the railways. I had seen on another map from another creator that he has the possibility without making mods that the wagons move in all directions, which means that the train has laid sideways in the rails like a real train also looked up when driving uphill. My problem is that I know that you can change the direction of view with the facing entity, but you can't turn it up and down. I would appreciate an answer.
With facing entity, the entities automatically look to the entity, regardless of whether it is above or below
You can also rotate entities btw with NBT
/ data merge entity @e [type = minecart] {rotation: [0F, 90F]}
The 0F is the left-right rotation (Yaw) and 90F is the up-down rotation (Pitch)