on rightclick with minecart:     if targeted block is not rail:         set block above targeted block to rail         wait 2 tick         spawn minecart at targeted block         loop blocks in radius 1 of targeted block:             if loop-block is rail:                 set loop-block to air         remove 1 minecart from player