Tested on Spigot-1.20.5, 1.21.
A Minecraft (Bukkit) plugin that allows to minecarts to auto-build their rails
If a chest minecart is moving and there is a solid block in the direction of movement.
1. Break two blocks in the direction of movement with the best pickaxe from the chest - or fail
2. Place the left-top regular rail from the chest in the direction of movement - or fail
3. If the minecart X or Z is NOT a multiple of 16 - finish
4. Break the right side block - or go to #7
5. If no solid block under right side, place the left-top solid block from the chest - or go to #7
6. Place the left-top redstone torch from the chest to the right side - or go to #7
7. If #4, or #5, or #6 didn't work for the right side, try for the left side - or fail
8. Place the left-top powered rail from the chest instead of the regular rail - or fail
A chest minecart needs the following inventory to build a 1000 block distance railway: 
autominecart reload - reload config from disk
- Access to 'reload' command:
autominecart.reload (default: op)
Default configuration file
I will be happy to add some features or fix bugs. My mail: uprial@gmail.com.
- CustomBazookas: Bukkit Dev GitHub, Spigot
- CustomCreatures: Bukkit Dev, GitHub, Spigot
- CustomNukes: Bukkit Dev, GitHub, Spigot
- CustomRecipes: Bukkit Dev, GitHub, Spigot
- CustomVillage: Bukkit Dev, GitHub, Spigot
- MasochisticSurvival: Bukkit Dev, GitHub, Spigot
- TakeAim: Bukkit Dev, GitHub, Spigot