Self-Laying Ghost Train

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.

Java EditionMini-games & UtilitiesEasy23 commandsTested on a real 26.2 & 26.3 server
A glowing spectral skeleton rides a minecart that automatically generates and vanishes its own rails. Download the GIF Video & GIF © www.9minecraft.net

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.

1. Setup - type these once 10 commands

  1. /scoreboard objectives add c9_rot dummy
  2. /team add c9_ghost
  3. /team modify c9_ghost color aqua
  4. /fill ~-7 ~-1 ~-7 ~7 ~-1 ~7 minecraft:polished_blackstone_bricks
  5. /fill ~-5 ~-1 ~-5 ~5 ~-1 ~5 minecraft:grass_block
  6. /fill ~-2 ~-1 ~-2 ~2 ~-1 ~2 minecraft:crying_obsidian
  7. /fill ~-1 ~ ~-1 ~1 ~ ~1 minecraft:soul_sand
  8. /fill ~-1 ~1 ~-1 ~1 ~1 ~1 minecraft:soul_fire
  9. /summon minecraft:armor_stand ~ ~ ~ {Tags:["c9_pivot","c9_ent"],Invisible:1b,NoGravity:1b,Marker:1b}
  10. /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}}}]}

2. Loop - one repeating command block each (Always Active) 13 commands

  1. /team join c9_ghost @e[tag=c9_ent]
  2. /execute as @e[tag=c9_pivot] at @s run tp @s ~ ~ ~ ~3.5 ~
  3. /fill ~-7 ~ ~-7 ~7 ~ ~7 minecraft:air replace minecraft:powered_rail
  4. /fill ~-7 ~ ~-7 ~7 ~ ~7 minecraft:air replace minecraft:soul_lantern
  5. /execute at @e[tag=c9_pivot] rotated ~ 0 positioned ^ ^ ^6 as @e[tag=c9_train] run tp @s ~ ~0.1 ~ ~90 ~
  6. /execute at @e[tag=c9_train] run fill ~-1 ~ ~-1 ~1 ~ ~1 minecraft:powered_rail[powered=true] replace minecraft:air
  7. /execute at @e[tag=c9_train] run setblock ~ ~ ~ minecraft:powered_rail[powered=true]
  8. /execute at @e[tag=c9_train] rotated ~ 0 positioned ^1.5 ^ ^1.2 run setblock ~ ~ ~ minecraft:soul_lantern
  9. /execute at @e[tag=c9_train] rotated ~ 0 positioned ^1.5 ^ ^-1.2 run setblock ~ ~ ~ minecraft:soul_lantern
  10. /execute at @e[tag=c9_train] run particle minecraft:soul_fire_flame ~ ~0.4 ~ 0.6 0.2 0.6 0.03 8 force
  11. /execute at @e[tag=c9_train] run particle minecraft:soul ~ ~1.0 ~ 0.4 0.3 0.4 0.02 2 force
  12. /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
  13. /particle minecraft:soul_fire_flame ~ ~2 ~ 0.8 0.8 0.8 0.04 5 force

How it works

Frames from the test run

Self-Laying Ghost Train - frame 1Self-Laying Ghost Train - frame 2Self-Laying Ghost Train - frame 3

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.

Build it in your world

  1. Open a flat world in creative mode and make sure cheats are enabled.
  2. Run each command from the Setup list one by one in your chat bar while standing at the center of your build area.
  3. Give yourself a repeating command block using /give @s repeating_command_block and place 13 of them in a row near the track.
  4. Set every command block to Repeat, Unconditional, and Always Active.
  5. Paste one command from the Loop list into each of the 13 repeating command blocks.
  6. Set the time to night with /time set midnight to see the aqua glow, soul lanterns, and soul fire particles clearly.

Use it with real players

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.

Remove it again 5 commands

  1. /team remove c9_ghost
  2. /scoreboard objectives remove c9_rot
  3. /kill @e[tag=c9_ent]
  4. /fill ~-8 ~ ~-8 ~8 ~2 ~8 minecraft:air
  5. /fill ~-8 ~-1 ~-8 ~8 ~-1 ~8 minecraft:grass_block

FAQ

Why do the rails and soul lanterns disappear right after the train passes?

The 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.

Can I make the ghost train move faster or cover a wider loop?

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.

Commands used

/execute/fill/particle/scoreboard/setblock/summon/team/tp

Similar creations

Join 9Minecraft News & Guides