Build a multi-part electric tram using block display entities that smoothly glides back and forth along a track with headlights, sparks, and station stops.
VehiclesTechnologyIndustrialRedWhiteCyanDecorationMap MakingServer LobbyBlock displaysSmooth animation (interpolation)Riding & passengersBlock building (fill/setblock/clone)Sounds21+ commands
Traditional Minecraft minecarts are limited to single-block carts on bumpy rails. Using block display entities and passenger mounting, you can assemble a multi-part electric tram that glides across a railway bed with smooth teleport interpolation.
This automated bidirectional railcar features a crimson body, tinted glass windows, glowing headlights, and a roof pantograph that emits electric sparks as it travels between two illuminated end stations.
/scoreboard objectives add c9_t dummy/scoreboard objectives add c9_dir dummy/fill ~-12 ~ ~-1 ~12 ~ ~1 gravel/fill ~-11 ~ ~ ~11 ~ ~ rail[shape=east_west]/setblock ~-12 ~ ~ chiseled_stone_bricks/setblock ~12 ~ ~ chiseled_stone_bricks/setblock ~-12 ~1 ~ sea_lantern/setblock ~12 ~1 ~ sea_lantern/summon block_display ~-8 ~0.2 ~ {Tags:["c9_train","c9_root"],teleport_duration:2,block_state:{Name:"minecraft:iron_block"},transformation:{translation:[-2.3f,0.2f,-1.1f],scale:[4.6f,0.25f,2.2f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]},Passengers:[{id:"minecraft:block_display",Tags:["c9_train"],brightness:{sky:15,block:15},block_state:{Name:"minecraft:red_concrete"},transformation:{translation:[-2.2f,0.45f,-1.0f],scale:[4.4f,0.9f,2.0f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]}},{id:"minecraft:block_display",Tags:["c9_train"],brightness:{sky:15,block:15},block_state:{Name:"minecraft:cyan_stained_glass"},transformation:{translation:[-2.1f,1.35f,-0.95f],scale:[4.2f,0.85f,1.9f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]}},{id:"minecraft:block_display",Tags:["c9_train"],brightness:{sky:15,block:15},block_state:{Name:"minecraft:quartz_block"},transformation:{translation:[-2.25f,2.2f,-1.05f],scale:[4.5f,0.25f,2.1f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]}},{id:"minecraft:block_display",Tags:["c9_train"],brightness:{sky:15,block:15},block_state:{Name:"minecraft:sea_lantern"},transformation:{translation:[-2.32f,0.65f,-0.3f],scale:[4.64f,0.3f,0.6f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]}},{id:"minecraft:block_display",Tags:["c9_train"],brightness:{sky:15,block:15},block_state:{Name:"minecraft:lightning_rod"},transformation:{translation:[-0.4f,2.45f,-0.4f],scale:[0.8f,0.8f,0.8f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]}}]}/scoreboard players set @e[tag=c9_root] c9_dir 1/scoreboard players add @e[tag=c9_root] c9_t 1/execute as @e[tag=c9_root,scores={c9_dir=1,c9_t=1..106}] at @s run tp @s ~0.15 ~ ~/execute as @e[tag=c9_root,scores={c9_dir=-1,c9_t=1..106}] at @s run tp @s ~-0.15 ~ ~/execute as @e[tag=c9_root,scores={c9_t=1..106}] at @s run particle electric_spark ~ ~3.1 ~ 0.1 0.05 0.1 0.02 2/execute as @e[tag=c9_root,scores={c9_t=1..106}] at @s run particle smoke ~-1.4 ~0.1 ~ 0.1 0.02 0.3 0.01 1/execute as @e[tag=c9_root,scores={c9_t=1..106}] at @s run particle smoke ~1.4 ~0.1 ~ 0.1 0.02 0.3 0.01 1/execute as @e[tag=c9_root,scores={c9_t=107}] at @s run particle cloud ~ ~0.2 ~ 1.8 0.1 0.8 0.02 25/execute as @e[tag=c9_root,scores={c9_t=107}] at @s run playsound block.iron_trapdoor.close master @a ~ ~ ~ 0.8 0.7/execute as @e[tag=c9_root,scores={c9_t=107..129}] at @s run particle dust{color:[1.0,0.75,0.1],scale:1.2} ~ ~2.3 ~ 1.8 0.05 0.9 0 3/execute as @e[tag=c9_root,scores={c9_t=130}] at @s run playsound block.note_block.bell master @a ~ ~ ~ 1 1.5/execute as @e[tag=c9_root,scores={c9_t=130,c9_dir=1}] run scoreboard players set @s c9_dir 2/execute as @e[tag=c9_root,scores={c9_t=130,c9_dir=-1}] run scoreboard players set @s c9_dir 1/execute as @e[tag=c9_root,scores={c9_t=130,c9_dir=2}] run scoreboard players set @s c9_dir -1/execute as @e[tag=c9_root,scores={c9_t=130}] run scoreboard players set @s c9_t 0setup #9 Summons the root iron base display with teleport_duration:2 for smooth movement, and mounts the body, windows, roof, headlights, and pantograph as passengers using decomposed transformation compounds so everything moves together without lag.loop #2 Glides the root block display 0.15 blocks east per tick while c9_dir is 1 and the travel timer c9_t is between 1 and 106 (covering 15.9 blocks total).loop #4 Emits electric_spark particles from the top of the lightning rod pantograph while the railcar is in motion.loop #7 Releases a burst of air brake cloud particles around the wheels when the railcar reaches the end station at tick 107.loop #11 Swaps the direction score c9_dir between 1 and -1 using a temporary value of 2 at tick 130 after a 1.15-second station pause, then resets the cycle timer.


Recorded on our own test server: 69 frames at about 9.8 fps. Our image check saw: A custom multi-block crimson and white railcar with glass windows and a sparking lightning rod on top glides back and forth along a gravel track between two sea lanterns.
Commands, video and screenshots: tested and recorded by www.9minecraft.net © 9Minecraft. Sharing a video or screenshot? Please credit www.9minecraft.net.
To let players ride the railcar, add an invisible pig or boat with NoGravity:1b,Silent:1b,Invulnerable:1b to the Passengers list inside Setup command 9. Players can right-click the seat inside the glass cabin to ride smoothly back and forth along the line.
/kill @e[tag=c9_train]/fill ~-12 ~ ~-1 ~12 ~1 ~1 air/scoreboard objectives remove c9_t/scoreboard objectives remove c9_dirWhen block displays ride a root entity as passengers, teleporting only the root entity moves the entire vehicle simultaneously without subtle desyncs between parts, and requires only one /tp command per tick.
Extend the /fill coordinates in Setup commands 3 and 4, move the end bumpers further out, and increase the 106 tick travel limit in the loop commands (each tick travels 0.15 blocks).
/execute/fill/particle/playsound/scoreboard/setblock/summon/tp
▶Steampunk Dirigible Anchor Winch MooringVehiclesMedium22 cmds
▶Holographic Wind Tunnel Aerodynamics TestVehiclesExpert25 cmds
▶Articulated Hydraulic Demolition ExcavatorVehiclesHard24 cmds
▶Automated Commuter Rail with Sliding DoorsVehiclesMedium25 cmds
▶Automated Express LocomotiveVehiclesHard24 cmds
▶Autonomous Steam Locomotive DisplayVehiclesHard23 cmds