Summon a spectral minecart ridden by an undead conductor that lays glowing powered rails and soul lanterns ahead while erasing the track behind in soul fire.
Spawners & GeneratorsHorrorDarkCyanBlackOrangeDecorationAdventure MapCinematicArmor standsRiding & passengersSummoned mobsBlock building (fill/setblock/clone)Rotation math21+ commands
The Self-Laying Ghost Train summons an aqua-glowing spectral locomotive and passenger car driven by an undead skeleton conductor. As the train glides around its dark stone roadbed, it automatically constructs glowing powered rails and soul lanterns right beneath its wheels while vanishing old track in bursts of soul fire.
Because the train generates and cleans up its own path every tick, it never runs out of rails and leaves no permanent mess behind. At the center of the track, a haunted soul fire monument casts flickering light over the phantom railway.
/scoreboard objectives add c9_rot dummy/team add c9_ghost/team modify c9_ghost color aqua/fill ~-7 ~-1 ~-7 ~7 ~-1 ~7 minecraft:polished_blackstone_bricks/fill ~-5 ~-1 ~-5 ~5 ~-1 ~5 minecraft:grass_block/fill ~-2 ~-1 ~-2 ~2 ~-1 ~2 minecraft:crying_obsidian/fill ~-1 ~ ~-1 ~1 ~ ~1 minecraft:soul_sand/fill ~-1 ~1 ~-1 ~1 ~1 ~1 minecraft:soul_fire/summon minecraft:armor_stand ~ ~ ~ {Tags:["c9_pivot","c9_ent"],Invisible:1b,NoGravity:1b,Marker:1b}/summon minecraft:minecart ~ ~0.2 ~-6 {Tags:["c9_train","c9_ent"],Glowing:1b,NoGravity:1b,CustomName:{"text":"Ghost Train","color":"aqua"},Passengers:[{id:"minecraft:skeleton",Tags:["c9_rider","c9_ent"],Glowing:1b,Silent:1b,NoAI:1b,PersistenceRequired:1b,equipment:{head:{id:"minecraft:carved_pumpkin",count:1},chest:{id:"minecraft:diamond_chestplate",count:1},mainhand:{id:"minecraft:soul_lantern",count:1}}}]}/team join c9_ghost @e[tag=c9_ent]/execute as @e[tag=c9_pivot] at @s run tp @s ~ ~ ~ ~3.5 ~/fill ~-7 ~ ~-7 ~7 ~ ~7 minecraft:air replace minecraft:powered_rail/fill ~-7 ~ ~-7 ~7 ~ ~7 minecraft:air replace minecraft:soul_lantern/execute at @e[tag=c9_pivot] rotated ~ 0 positioned ^ ^ ^6 as @e[tag=c9_train] run tp @s ~ ~0.1 ~ ~90 ~/execute at @e[tag=c9_train] run fill ~-1 ~ ~-1 ~1 ~ ~1 minecraft:powered_rail[powered=true] replace minecraft:air/execute at @e[tag=c9_train] run setblock ~ ~ ~ minecraft:powered_rail[powered=true]/execute at @e[tag=c9_train] rotated ~ 0 positioned ^1.5 ^ ^1.2 run setblock ~ ~ ~ minecraft:soul_lantern/execute at @e[tag=c9_train] rotated ~ 0 positioned ^1.5 ^ ^-1.2 run setblock ~ ~ ~ minecraft:soul_lantern/execute at @e[tag=c9_train] run particle minecraft:soul_fire_flame ~ ~0.4 ~ 0.6 0.2 0.6 0.03 8 force/execute at @e[tag=c9_train] run particle minecraft:soul ~ ~1.0 ~ 0.4 0.3 0.4 0.02 2 force/execute at @e[tag=c9_train] rotated ~ 0 positioned ^-2 ^0.3 ^ run particle minecraft:trial_spawner_detection_ominous ~ ~ ~ 0.3 0.2 0.3 0.01 6 force/particle minecraft:soul_fire_flame ~ ~2 ~ 0.8 0.8 0.8 0.04 5 forcesetup #3 Creates the <code>c9_ghost</code> team and sets its color to aqua so the minecart and its skeleton conductor have an ethereal cyan outline.setup #10 Summons the glowing ghost minecart with an undead skeleton passenger wearing a carved pumpkin, diamond chestplate, and holding a soul lantern.loop #2 Rotates the invisible central pivot armor stand by 3.5 degrees every tick to drive the train smoothly along its circuit.loop #3 Clears old powered rails across the track area every tick before laying fresh ones around the train's new position.loop #5 Teleports the ghost train 6 blocks out from the rotating pivot using local coordinates <code>^ ^ ^6</code> and turns it perpendicular to face forward along the track.loop #6 Materializes activated powered rails directly beneath and ahead of the train as it moves.loop #8 Places soul lanterns to the left and right of the rails ahead of the train, which vanish automatically behind it on the next tick.


Recorded on our own test server: 59 frames at about 9.7 fps. Our image check saw: An aqua-glowing minecart train with a skeleton conductor wearing a pumpkin head moves around a dark stone track surrounding a central soul fire pit, generating and removing powered rails and leaving soul fire particles in its wake.
Commands, video and screenshots: tested and recorded by www.9minecraft.net © 9Minecraft. Sharing a video or screenshot? Please credit www.9minecraft.net.
To ride the self-laying ghost train yourself instead of having the skeleton conductor drive on a fixed pivot, remove the passenger from the minecart summon command and replace loop command 5 with /execute as @a at @s if entity @s[nbt={RootVehicle:{Entity:{Tags:["c9_train"]}}}] run tp @e[tag=c9_train,limit=1] ^ ^ ^0.4 ~ ~. The minecart will glide wherever you look while laying glowing rails and soul lanterns beneath you.
/team remove c9_ghost/scoreboard objectives remove c9_rot/kill @e[tag=c9_ent]/fill ~-8 ~ ~-8 ~8 ~2 ~8 minecraft:air/fill ~-8 ~-1 ~-8 ~8 ~-1 ~8 minecraft:grass_blockThe loop commands clear all powered rails and soul lanterns in the track zone at the start of every tick and immediately place new ones around the train's current position, creating the illusion that the track is being built ahead and burned away behind.
Yes. Increase the rotation angle in loop command 2 from ~3.5 to ~5 for higher speed, or change ^ ^ ^6 in loop command 5 to a larger distance to widen the circle.
▶Shattering Hourglass Ice-Sculpture SpawnerSpawners & GeneratorsHard24 cmds
▶Deep-Sea Anglerfish Maw Mob SpawnerSpawners & GeneratorsHard24 cmds
▶Hurdy-Gurdy Rosin-Wheel Boss SummonerSpawners & GeneratorsHard24 cmds
▶Nether Portal Vortex Rift SpawnerSpawners & GeneratorsHard24 cmds
▶Runic Obelisk Mob Wave SummonerSpawners & GeneratorsHard25 cmds
▶Self-Building Endless LabyrinthSpawners & GeneratorsMedium24 cmds