Clouds Clouds Airship Belthil Tower Nether Temple
📚 Learn more about The Shire's history on our Timeline. 🕰

Fast Rails v2

Options
After about 5 hours of command block copy-pasta, I've created a stable, reliable form of rail acceleration.
- it works by detecting "marker blocks" under the rails. In the screenshot, the markers are gold and gold ore blocks
- gold block marks acceleration over the next straight section, up until the two gold ore blocks. 
- it only works for straight sections. New marker blocks need to be re-applied after corners.
- it is tag based, meaning that only minecarts on STA will be affected.
- it is completely player-independent, meaning that all tags are info are stored on minecarts.
- acceleration can potentially support slopes and diagonals, but it requires more copy pasting.
- confirmed to be multiplayer-compatible as I tested the track with multiple creepers.
- since the command ties to minecarts, the rider, be it a mob or a player, doesn't matter.
- if an accident happens, the player can simply hop out and re-place the cart to refresh the tags.
- the only possible accidents are derailing at junctions and getting stuck in the wrong direction.
- simply don't let carts speed through junctions, only place markers at straight sections.
- directions should not be a problem since Andy's STA mod removes friction.
- it accelerates to 20 blocks/second, however can be modified to support 40, 60 or 80.
- the carts never derail if marked properly.
- it uses a coordinate system to create the illusion of fast movement, so the speed of carts are unchanged.
- tags can be erased by a single command block on detector rail at the stations. This is mostly a fail-safe, but any special carts with STA-routing tags will also be wiped. Use with caution.
- it currently only accelerates carts on regular tracks, but with copy-paste can support any type of rail.

Here are the command blocks:
image
The left column are the accelerators, commands in order are:

/execute @e[type=MinecartRideable,tag=westFast] ~ ~ ~ detect ~ ~ ~-1 minecraft:rail 0 /tp @e[type=MinecartRideable,r=1] ~ ~ ~-1

/execute @e[type=MinecartRideable,tag=southFast] ~ ~ ~ detect ~1 ~ ~ minecraft:rail 1 /tp @e[type=MinecartRideable,r=1] ~1 ~ ~

/execute @e[type=MinecartRideable,tag=eastFast] ~ ~ ~ detect ~ ~ ~1 minecraft:rail 0 /tp @e[type=MinecartRideable,r=1] ~ ~ ~1

/execute @e[type=MinecartRideable,tag=northFast] ~ ~ ~ detect ~-1 ~ ~ minecraft:rail 1 /tp @e[type=MinecartRideable,r=1] ~-1 ~ ~

The center column are the start-marker detectors, commands are:

/execute @e[type=MinecartRideable,tag=!eastFast] ~ ~ ~ detect ~ ~-1 ~-1 minecraft:gold_block 0 /scoreboard players tag @e[type=MinecartRideable,r=1,tag=!westFast] add westFast

/execute @e[type=MinecartRideable,tag=!northFast] ~ ~ ~ detect ~1 ~-1 ~ minecraft:gold_block 0 /scoreboard players tag @e[type=MinecartRideable,r=1,tag=!southFast] add southFast

/execute @e[type=MinecartRideable,tag=!westFast] ~ ~ ~ detect ~ ~-1 ~1 minecraft:gold_block 0 /scoreboard players tag @e[type=MinecartRideable,r=1,tag=!eastFast] add eastFast

/execute @e[type=MinecartRideable,tag=!southFast] ~ ~ ~ detect ~-1 ~-1 ~ minecraft:gold_block 0 /scoreboard players tag @e[type=MinecartRideable,r=1,tag=!northFast] add northFast

The right column are the end-marker detectors (green blocks), commands are:

/execute @e[type=MinecartRideable] ~ ~ ~ detect ~ ~-1 ~-1 minecraft:gold_ore 0 /scoreboard players tag @e[type=MinecartRideable,r=1] remove westFast

/execute @e[type=MinecartRideable] ~ ~ ~ detect ~1 ~-1 ~ minecraft:gold_ore 0 /scoreboard players tag @e[type=MinecartRideable,r=1] remove southFast

/execute @e[type=MinecartRideable] ~ ~ ~ detect ~ ~-1 ~1 minecraft:gold_ore 0 /scoreboard players tag @e[type=MinecartRideable,r=1] remove eastFast

/execute @e[type=MinecartRideable] ~ ~ ~ detect ~-1 ~-1 ~ minecraft:gold_ore 0 /scoreboard players tag @e[type=MinecartRideable,r=1] remove northFast

The station command block that clears tags contains:

entitydata @e[type=MinecartRideable,r=1] {Tags:[]}

Here's the test track:
image
Gold blocks indicate acceleration towards gold ores.

Here's the test track in stress test:
image
The creepers have been going on their accelerated loopy journey throughout the duration of me writing this post.

Note about lag: shouldn't be an issue as long as the command block output is set to X. 8 repeating command blocks is miniscule.

Comments

  • CoffeeAndChill
    CoffeeAndChill Lord, Arbiter, Engineer
    Options
    is it just one set of command blocks for the entire world & if their chunk gets unloaded, then will they stop working?
  • CoffeeAndChill
    CoffeeAndChill Lord, Arbiter, Engineer
    Options
    I tried to set this up and I can't get it to work. I'll show you next time we're on together

    image
  • Anomaloavis
    Anomaloavis Member
    edited December 2016
    Options
    Supposedly it works regardless of distance, even if the player is in the nether.
    A way to debug it is to place down a gold block, put a named minecart beside it, do 
    /scoreboard tag players <name> list
    and see if you have a tag called <...>Fast
    If you don't, scoreboards ain't working. If you do then it's the fault of the teleporter.
    Post edited by Anomaloavis on
  • CoffeeAndChill
    CoffeeAndChill Lord, Arbiter, Engineer
    Options
    Thank you, I'll have a look when I'm free! :) 
    Long drive today :'(
  • CoffeeAndChill
    CoffeeAndChill Lord, Arbiter, Engineer
    Options
    Sooooo 1.13 killed this

    If anybody can have a play around and get fast rails working again, that would be pretty cool. just sayin'.