Minecraft wiki entry for Command_blocks_and_functions, associated text: /setblock ~ ~1 ~ minecraft:spawner{SpawnPotentials:[{Entity:{id:"<Entity>",Passengers:[{id:"minecraft:minecart"(or "minecraft:boat")}]}}]}