Clouds Clouds Airship Belthil Tower Nether Temple

Win a free journey on the STA Railways network

  1. Read this:
  2. Adapt it to detect when a minecart passes over a specific kind of block
  3. Make minecarts stop for X seconds when they pass over the specific kind of block (Redstone ore?) — constantly teleport the minecart to its current coordinates??
  4. Stop teleporting the minecart to itself, and it should continue

Can you crack it?


  • Do the commands need to be active all the time, and work for any minecart that passes over redstone ore?
  • CoffeeAndChill
    CoffeeAndChill Lord, Engineer
    edited June 2017
    Do the commands need to be active all the time, and work for any minecart that passes over redstone ore?

    yes. using repeater/chain command blocks.

    delay should be 3 seconds (~60 ticks).
  • GJRickard
    GJRickard Wiki Editor
    you use traincarts
  • Done.
    5 repeating blocks, 6 chain blocks
    Iron block to stall, iron ore a few blocks in front to clean up tags.
    Run once:
    /scoreboard objectives add time dummy
    From right <<to<< left:

    Repeats (Unconditional, no redstone):
    /scoreboard players add @e[score_time_min=1] time 1
    /kill @e[score_time_min=DELAY_IN_TICKS,tag=stuck]
    /execute @e[type=Armor_stand,tag=stuck] ~ ~ ~ tp @e[type=Minecart,tag=stalled,r=0.4] @e[type=Armor_stand,tag=stuck,r=0]
    /execute @e[type=Minecart] ~ ~ ~ detect ~ ~-1 ~ minecraft:iron_block 0 /scoreboard players tag @e[type=Minecart,r=0.1,tag=!stalled] add stall
    /execute @e[type=Minecart] ~ ~ ~ detect ~ ~-1 ~ minecraft:iron_ore 0 /scoreboard players tag @e[type=Minecart,r=0.1,tag=stalled] remove stalled

    Chains (all chains set to Conditional, no redstone):
    /execute @e[type=Minecart,tag=stall] ~ ~ ~ /summon Armor_stand ~ ~ ~ {Tags:["stucking"],NoAI:1,NoGravity:1,Invisible:1,Invulnerable:1}
    /execute @e[type=Minecart,tag=stall] ~ ~ ~ scoreboard players tag @e[type=Minecart,tag=stall,r=0.1] add stalled
    /execute @e[type=Minecart,tag=stall] ~ ~ ~ scoreboard players tag @e[type=Minecart,tag=stall,r=0.1] remove stall
    /scoreboard players set @e[tag=stucking,type=Armor_stand] time 1
    /scoreboard players tag @e[tag=stucking,type=Armor_stand] add stuck
    /scoreboard players tag @e[tag=stucking,type=Armor_stand] remove stucking

    Does not work when multiple carts on the same track (ie if a second cart arrives before the first one leaves, the system breaks.
    When the system breaks, it leaves a bunch of invulnerable, invisible armor stands.
    -However, this can be fixed by simply exiting the cart or otherwise destroying the cart.

    Notes for Andy:
    Remember to use minecraft:tp on servers.
    Remember to check for invisible characters.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Railway Status

To plan your journey, click here.