Advertisements

The ramblings of Minecraft addict VladTubaka

Tag Archives: minecarts

You know, I’ve never really spent a whole lot of time on Minecraft’s minecarts until pretty recently. It always seemed more effort than it was worth, particularly when I started using mods (which happened within a couple of months of my introduction to Minecraft). Classic Technic/Tekkit included Railcraft, but … I dunno … I just never really got the vision of the mod as a whole, even though I tended (early on) to include it in my own personal modpacks.

But recently (as you may have noticed), I’ve returned to the joy of just plain old vanilla Minecraft (albeit, the newest versions of it). And as I’ve explored the way the base game is constructed more thoroughly, particularly in the realm of automation and Redstone mechanics, what I’ve seen is that minecarts are actually a tremendously fun feature of the game with tremendous potential for automating processes other than “take-stuff-from-here-to-there-repeatedly”.

For example, hopper carts can be used to evenly distribute items and fuel amongst multiple furnaces. Now, before you say anything, I know … I know that there are furnace arrays out there that DON’T use minecarts, only hoppers, and they are very, very fast. I realize that. I’ve used them myself. They work great. They’re also boring when compared with the joy of watching minecarts do all the work.

“But actually, that’s highly inefficient. The most efficient way to …” Stop. I don’t want to be rude, so just … stop. I don’t play Minecraft for efficiency. If I were that concerned about efficiency, why in the world would I be playing a dadgum video game? Surely, there are more productive things to be doing with my time. The glory of Minecraft isn’t efficiency, it’s creativity, the union of function and beauty. Sometimes efficiency can be beautiful. But sometimes it’s just dog ugly, like a federal government building.

It just so happens, though, that I have introduced a bit more efficiency into this furnace array than I have seen in other minecart-based furnace arrays. Typically, a minecart-based furnace array that one might see on YouTube simple has the minecarts going all the time and never stopping. With my furnace array, minecarts only move when there is a need for them to move, which means only when (1) items to be smelted need to be distributed, (2) fuel needs to be distributed, or (3) smelted items need to be collected.

Distributing Items and Fuel Amongst the Furnaces

You can do this a couple of ways. The way that uses the fewest rails is to have the minecart go back and forth rather than in a loop.

For this furnace array, I am using eight furnaces. This design can easily be expanded a lot, perhaps indefinitely.

Hoppers on top of furnaces will direct items into the smelting slot. Rails on these hoppers must not be powered rails, since activated powered rails will prevent the hopper below it from pushing items into the furnace.

One side of this furnace array is simply going to send the hopper cart back. The other side is going to determine whether the hopper cart should go back over the furnaces another time (to continue distributing items) or whether it should return to its default position (where it receives items to distribute). This is done by using a detector rail with an adjacent comparator. When the minecart passes over the detector rail and has items in its inventory, you want the cart to go straight (as will happen in the photo below) so that it will be sent back over the furnaces. If there are no items in the cart’s inventory, then you want it to turn off to the side.

This is a simple setup that determines the direction of the minecart based on whether it has items in its inventory or not. How this is set up precisely depends on direction. In this photo, the line of furnaces (and the longer stretch of rail) goes north-south, with south being on the right of the photo (west is up). Remember that at a t-junction, by default rail will connect to the south or to the east (positive X and Z). With a Redstone signal the t-junction will connect to the north or to the west (negative X and Z). Keep direction in mind when planning this kind of project.

This is a closer look at the way the detector rail system works. Remember, the setup in this photo will work ONLY if what is down in the photo is south or east. The Redstone would have to be a little different if “down” were north or west. To the right in the photo is the direction of the cart’s resting place.

This setup will send a hopper cart back and forth over the furnaces until it is empty, at which point it will return to its resting place to await more items to distribute.

The same setup works to distribute fuel, just with the hoppers pointing into the backs (or fronts) of the furnaces.

At either end of the fuel distribution tracks, I find it necessary to drop the track by a block in order to prevent any unwanted rail connections between the “smelt” and “fuel” tracks. Otherwise, the Redstone and rail setup are exactly the same.

Detector rail and other Redstone is exactly the same for the fuel distribution line. This photo is looking to the southwest.

Dropping Off Items and Fuel All Fancy Like

Obviously, to drop off items and fuel to be distributed you could just manually put them in the minecarts and hit a button to send them off, but where’s the fun in that?

What I have done in my example build is have my distribution minecarts resting below the floor of the “front” of the furnace array. A hopper sits above these minecarts at floor level. The player is intended to place items directly in these hoppers.

The top of the hopper here sits at floor level. This is a simple falling edge circuit that I’ve talked about before that will activate the powered rail on which the hopper cart sits once the hopper empties itself. The last repeater needs to be set on at least 3 ticks (right click twice).

The carts that distribute fuel and items to be smelted rest below the floor.

This is what how I connected my new distribution carts’ resting places to the existing rail systems.

Another look to help you see how everything fits together.

If you do it this way, you can use hopper carts. If, on the other hand, you want to put items in a chest or use some other item transportation or sorting system to send items into this furnace array, you’ll probably need to use chest carts instead of hopper carts. This is because items entering the hoppers one by one move so quickly through the hoppers into hopper carts that the comparators that generate the input for the falling edge detectors fail to register any items within the hoppers and, consequently, fail to send the hopper carts on their way once the hopper is empty.

Collecting Smelted Items

Once items are smelted, they need to be collected, and again we will do this via hopper minecart. If you want your collection cart to move only when there are items to be collected, you must set your furnaces on a line of downward facing hoppers. Smelted items will drop automatically into these hoppers. Next to the outermost two hoppers we need to place comparators, and using Redstone dust and repeaters the signals from these comparators will be used to activate the powered rail on which our collection cart will rest by default. Because we are using a back-and-forth distribution setup, the outer two furnaces in the line are the ones that are most likely to have items if the load of items to be smelted is not a multiple of the number of furnaces.

Okay, let me break that down a little. In my example I have eight furnaces. If I send in a multiple of eight items to be cooked (8, 16, 24, 32, etc.), then all the furnaces will have exactly the same number of items to cook (my total divided by eight, so eight each for a stack of 64 iron ore), and consequently all the furnaces will finish cooking at approximately the same time. But if I send in 9 items or 17 items, then one of the furnaces is going to go through one extra cooking process, right? That furnace will be one of the two outermost furnaces (which one depends on whether the total number of items minus the modulus is an even or odd multiple of the number of furnaces). This is why we use two comparators. If any furnace has extra items, one of the two outermost furnaces will.

Comparators reading the inventories of the hoppers under the outermost furnaces will make sure we always collect all smelted items.

The Redstone signal emitted by these comparators activates the collection cart (another hopper cart). We then want the collection cart to pass under the hoppers, go to a drop off point, and then (once items have been dropped off) return to its resting place to await further instructions. So what we need is to have a rail loop with three sequential destinations. This is pretty easy to pull off.

You can create a circular sequence of destinations like this. Which intersections have to be powered with a Redstone signal depends on which direction the rails are going. Just use some levers and fiddle around with it. In this picture, bottom left is the resting place. Once the button is pressed, a cart will go to the top center station, then the right station, then back to the bottom left and stop.

This is just like the example in the previous picture. The resting place is bottom left, the collection point is up, and the drop off point is right. A hidden lever is powering the top right rail intersection.

In the photo above, I have used a simple hopper drop-off point that I’ve demonstrated in previous posts. A barely visible chest receives the cooked items. This collection system will work until all items have been collected from the furnace array.

And there you have it: a minecart powered furnace array that, rather than having minecarts constantly moving, only sends minecarts when they are needed. Now, there’s all sorts of ways to dress this up and modify it. It isn’t a fixed system that if you move one block here or there it stops working. And like I pointed out above, this kind of thing can be expanded quite a bit. Up to 32 furnaces is easy-peasy with hardly any modifications at all. Beyond that, you will need to start doing some moderate modifications, but nothing serious … nothing you can’t figure out. With all the rail, I don’t really know if this saves much in the way of resources from the strictly hopper based furnace arrays (I do think it saves some), but I find this kind of furnace far more interesting to build and observe in operation.

Advertisements

Today we look at a more advanced, versatile, and intelligent minecart loading system.

Last post I talked about two simple Redstone devices that you can use to automatically load and unload minecarts if you want to use minecarts as an item transferral system. I briefly mentioned some of the limitations of the falling edge circuit as a loading system. In short, a simple falling edge circuit just isn’t smart enough to provide the versatility you might need if, say, you want to just dump a whole bunch of stuff into a chest and let the minecart system figure out how to get all those items from point A to point B. Today, I want to show you a more advanced loading and transferral system that works really well, never gets clogged, and actually gets a little faster and more efficient the more items you load into it.

Direction Affects Redstone

Exactly how you set up a system like this is going to depend on which direction your building it, because T-intersections with Minecraft’s rails work differently depending on which axis the straight track is on. If the straight track is going east-west (along the X axis), then an unpowered intersection from the north or south will curve to the east (which is positive X), while powering that intersection with Redstone will make it curve to the west (negative X). If the straight track is going north-south (along the Z axis), then an unpowered intersection from the east or west will curve to the south (positive Z), and a powered intersection will curve to the north (negative Z). All this means is that the Redstone might look a little different depending which direction everything is facing.

If the straight track is along the X axis (east-west), an unpowered intersection points to the east.

While a powered intersection points to the west.

If the straight track is along the Z axis (north-south), an unpowered intersection points to the south.

While a powered intersection points to the north.

Faster Loading

So the first thing I dislike about the simple falling edge loading system I showed last week is how slow it is. The problem is that it is bottlenecked by going through a single hopper.

Now, if you are loading items directly into the hopper and if it is loading items into a hopper cart, then items will flow out at a pretty good clip. But unless you are putting items directly into the loading hopper via the GUI (right-clicking to see the slots), you don’t want to use a hopper cart because items will flow through the hopper from another inventory too quickly for the comparator to register their presence, meaning the falling edge circuit won’t work, period.

This system works but it is slow. Note that an auto-loading system that pulls items from a chest must load into a chest cart and not a hopper cart so that the comparator can register items passing through the hopper.

Items flow much faster from a hopper into a hopper cart, but you have to load items into the hopper manually.

The loading speed can be doubled by using a double chest, two hoppers, and a hopper cart. One hopper points into the hopper cart while the other hopper points into the first hopper. This not only unloads the chest twice as quickly, it loads the hopper cart (but not a chest cart) just as quickly as it can empty the chest, making for a double speed falling edge minecart loading system.

A double chest over two hoppers empties twice as quickly.

Place the comparator behind the hopper that empties into the other hopper, not the one that empties into the cart.

This is a compact way to get the Redstone signal down to the falling edge circuit.

Here is the falling edge circuit up close. It outputs into the block on which the powered rail sits.

But you still have to be careful not to put more into your double chest than your hopper cart can hold. Otherwise the Redstone signal from the comparator will never turn off allowing the falling edge circuit to pulse and send the minecart away. So you are limited to putting in only five stacks of items (or five different kinds of items) at a time. This kind of loader also doesn’t deal with a single item very well (you need to make sure that comparator sits behind the hopper that is either to the south or to the east, because a single item will go south or east, given an option). It works great if you place five or fewer stacks of items into the chest, but it isn’t smart enough to handle other kinds of situations.

Intelligent Loading

If we want a more intelligent loader that can manage an indefinite number of items, we have to do something different. I have built a system that works really well, but it certainly isn’t the only solution, and it most likely isn’t the most elegant solution. But it works and it was fun to build. So there.

(1) A Double Chest Evenly Distributes Items Among Six Hoppers

The first task is getting items out of the deposit chest and into a hopper cart as quickly as possible. As we saw above, double chest over two hoppers will empty at double speed. I have those two hoppers send items out into two 3-long hoppers chains going in opposite directions (to create a line of six hoppers). Using a little Redstone trick I’ve seen in a number of really impressive furnace arrays on YouTube recently, those items get distributed evenly amongst six other hoppers where they await pickup from a hopper cart.

A double chest empties into two different hopper chains going in opposite directions.

The bottom row of hoppers is disabled by this line of Redstone until an item enters the south-most hopper of the upper level (the hopper next to the comparator in this image). As soon as an item enters this hopper, the Redstone signal is disabled for an instant, dropping the items in the top row of hoppers (one item will be in each hopper) into the bottom row of hoppers.

Remember that the comparator that triggers the drop of items into the lower level of hoppers needs to be next to the hopper that is farthest to the east or the south (positive X or Z).

(2) The Hopper Cart is Released and Begins a Loading Circuit

As soon as there is an item in the south or east-most hopper on the lower level, another comparator sends out a Redstone signal that both releases the delivery hopper cart and closes a loop of rail to keep the cart loading until either it is full or everything from the chest has been picked up by the minecart.

When an item enters the south-most hopper on the lower level, a comparator sends a different Redstone signal.

This new signal disables a Redstone signal that is currently causing the track loop in this image to be open. This means that so long as there something in that hopper, the loop will be closed, unless the minecart is close to full. If the minecart is close to full, the detector rail will reactivate that Redstone signal, opening the loop and sending the minecart to its destination even if there is still something in the above-mentioned hopper.

Beneath the hopper cart here is a powered rail sitting on a grass block above a Redstone torch. By default that torch is disabled by the Redstone signal at the bottom of the image. When something enters the south-most hopper on the lower level, not only does it close the track loop, but it also activates the powered rail (after a little delay), sending the minecart to begin collecting items from the lower level of hoppers.

(3) When the Cart Returns It Checks to See if There is Anything Left to Pick Up

The presence of items in the east or south-most hopper not only initiates the minecart’s collection circuit, it acts as a check for a minecart that is returning from its destination after having dropped off its load. Here I use a dropping one-way entry to make sure the cart goes in only one direction. The cart drops from a track two blocks above to land on its starting point.

The cart returns via a different route (using another t-junction) and drops the cart onto its starting point so that it can either check to see if there are items still awaiting pickup or await a new deposit in the double chest.

I don’t pretend that this is the most compact or most elegant way to do any of this. Actually, making it a little bigger than it needed to be helps make all the parts of this intelligent loading system more obvious. What I like about this system is that it is self-resetting, it works with any number of items deposited into it, it cannot be clogged up by too many items, and it only works so long as items need to be sent. Systems designed to have minecarts constantly moving not only hog server resources but also are subject to failure whenever the game shuts down.


This is a minecart-based furnace array. It uses Redstone powered automatic loading and unloading systems that I’ll show you in this post.

While many mods add item transfer mechanics into the game (pipes, tubes, conduits, conveyor belts, etc.), vanilla Minecraft actually has had item transfer systems built in for a long time in the form of minecarts. Back in the day (classic Tekkit and some time afterwards), if people used minecarts to transfer items it was pretty much only via additions provided with the Railcraft mod. With the MC 1.5 Redstone update, all of a sudden it became possible to load items into and out of minecarts automatically using hoppers and comparators. Today, I want to cover two simple Redstone devices that you can use to unload and load minecarts automatically.

Unloading Minecarts (Then Sending Them Back When Empty)

Of the two functions of minecart-based item transfer (loading and unloading the minecart), unloading the minecart is by far the easier. The way this is done is by placing a powered rail at the end of a track over a hopper. A comparator reads if anything is in the hopper and, so long as there is, depowers the powered rail over the hopper (thereby keeping the minecart still until it is empty). Once the hopper finishes transferring items from the minecart into a nearby inventory, the powered rail is once again powered, sending the minecart back where it came from.

This is one simple way to keep a minecart in place over a hopper until it is empty …

… and this is another.

Loading Minecarts (i.e., Waiting to Send the Minecart Until Finished Loading)

Obviously, the easiest way to load items onto minecarts is manually: right click the minecart, put the items in, then activate the powered rail it sits on and send it away.

On the other hand, automatically loading the minecart – and specifically designing your Redstone setup so that the cart is sent once it is loaded – is more complicated. Part of the reason it is more complicated is that the only way you can measure the fullness of a minecart directly is by having the minecart sitting on a detector rail and placing a comparator next to that detector rail. The comparator will then read the fullness of the minecart. Unfortunately, there is no way to cause a stationary minecart sitting on a detector rail to start moving. That is what powered rails are for, and vanilla Minecraft just doesn’t have a rail that combines those two functions.

Here we have a detector rail next to a powered rail.

Whenever a minecart is on top of a detector rail, period (regardless of fullness), it will emit a Redstone signal to adjacent blocks, including powered rail.

There actually is a solution using sticky pistons, but it doesn’t seem to be 100% reliable (sometimes the rail breaks, sometimes it doesn’t). But here’s a picture:

This setup detects when a minecart is full then uses a sticky piston to push the minecart over one block. Then another sticky piston pulls back, letting the cart drop onto another set of tracks.

Maybe I’ll post about this in the future once I have some idea of how reliable it is.

So what we have to do is have our minecart sitting on a “depowered” powered rail (to keep it stationary) and detect the contents of a hopper that is loading items onto the minecart with a comparator. But obviously we don’t want the rail powered as soon as items enter into the loading hopper. Instead, we want the cart to go on its merry way once items have finished passing through the hopper. This requires a special Redstone circuit called a “falling edge” circuit. A falling edge circuit sends an output pulse when an input pulse ends. So if I am using a lever as the input for a falling edge circuit, the output will pulse only when I turn the lever off after having also turned it on. And it will only pulse, not stay on, as would happen with a NOT gate (i.e., a Redstone torch).

Here’s a sample loading setup: a chest on a hopper loading into a chest cart.

And this is my somewhat messy falling edge circuit. It will pulse only when the hopper empties after having had something in it.

This is a cleaner falling edge loader.

This is the basic Redstone for this kind of falling edge circuit (there are others). The top left (according to the picture) repeater that leads into the side of the top right repeater blocks the signal from passing through that repeater. When the input turns back off, a residual Redstone signal will pulse if the last repeater is set to three or four ticks (three in this picture).

When the input (the lever) is on, the output (the Redstone lamp) remains off).

When the lever is turned off, the Redstone lamp will pulse on for just a moment then turn back off. This pulse is long enough to power a powered rail and send a cart away.

The main thing you have to make sure you don’t do is load more into the loading hopper than your minecart can hold. So, for example, if the minecart you’re using to transport items is a hopper cart versus a chest cart, you wouldn’t want to place six stacks of items into a chest above the loading hopper, since only five of those stacks will successfully load onto the hopper cart, leaving a stack of items inside the hopper. Because the input from the comparator next to the loading hopper will never turn off, the falling edge circuit will never pulse to send the minecart away.

In many situations where you have a system producing items (a reed farm, for example), this won’t be a problem. The system won’t produce at a time more items than your minecart can hold. If, on the other hand, you want to be able to dump tons of items into a chest and let the item transport system regulate itself, you’re going to need a somewhat more advanced setup. I’ll cover one such setup in next week’s post.

Here’s a preview of a more full featured loader.



%d bloggers like this: