Minecart

A minecart is a train-like vehicle entity that runs on rails.

Obtaining
Minecarts can be retrieved by them for some time. Minecarts can also be retrieved with one attack from a pickaxe provided the player's attack cooldown is reset. A minecart is also destroyed if it makes contact with a cactus, or if shot with a bow and arrow.

Entity loot
Minecarts with chests, with hoppers, with furnaces, and with TNT each drop 1 minecart & 1 chest, hopper, furnace, or TNT, respectively. Minecarts with TNT that are detonated do not drop; the minecart is destroyed in the blast.

Minecarts with command blocks can be given to the player only with the command; minecarts with spawners are available only via the  command. Each drop 1 minecart when broken.

Usage


A minecart can be placed in the same manner as most blocks but can be placed only on top of a rail. Once placed, it may be derailed by pushing it off the end of the track. After this, it can be railed again by placing a rail directly below it or pushing it onto a track.

Transportation


Minecarts can be ridden by on them. Once inside, an external impulse may be needed to make the minecart start moving. The player can slowly move the minecart forward while riding it, by pressing. If a mob walks in front of an empty minecart, it is pulled into the cart.

Players can exit the minecart by pressing, however, if there is only one block of headroom above the cart, the player takes of suffocation damage. When a minecart is exited, it searches for an adjacent or diagonal 2×2×3 area to put the player 1.5 blocks away from the cart. If none are available, the player is deposited directly above the minecart. Consequently, the player falls inside the minecart.

After rolling off of the end of a track, a minecart can be pushed around on open blocks. If a minecart is pushed onto or falls onto tracks, it "snaps" to those tracks. When riding a minecart, if the minecart lands on a rail, the player does not take any fall damage.

Unlike with beds, there is no message above the hotbar for attempting to enter a fully occupied minecart.

Speed
Minecarts have a predefined speed limit of exactly 8 blocks per second per axis of travel. A minecart traveling diagonally can, therefore, travel up to 11.314 blocks per second. When a minecart comes to a turn it moves diagonally across that turn.

Powered rails powered by redstone give minecarts a boost of speed. Speed is gradually decreased if there are no powered rails to assist its movement, and an unpowered powered rail slows down a minecart rapidly. The speed decreases at a faster rate when going uphill, compared to when moving horizontally. A minecart does not need powered rails to assist its movement down a hill.

Anything in the way of the minecart brings it to a stop. Once a minecart has left the track, it rapidly decelerates within one or two blocks. When mobs touch a minecart, they affect it in the same way a player would, i.e. mobs that move up against a still cart set it in motion.

If a minecart is moving fast enough, it can skip across one block without a track and reattach to track on the other side, at significantly reduced energy and speed. A minecart's hitbox can skip turns if the minecart is boosted using enough powered rails.

The speed and momentum of a minecart can differ depending on whether or not it is empty, and in the case where a minecart has a container, the speed can differ depending on the quantity and type of items inside.

Merged minecarts
$$, two or more minecarts can be merged by pushing them into each other so that they overlap. Merged minecarts move as a collective, like a train, and can be useful for long-distance transport because while moving in a straight line, they do not need powered rails to keep their speed.

To summarize:
 * Minecarts can also be merged by dropping a minecart on another minecart.
 * Merged minecarts do not lose speed while traveling on straight rails
 * Corners in the rails might cause merged minecarts to unmerge.
 * Minecarts with chest (even fully filled) can also be merged and also do not require powered rails.

Distance traveled by empty carts starting on a downward slope
This table shows the distance traveled by an unoccupied minecart on a downward slope, with a boost (or no boost). The most efficient way is to use only 1 boost at the bottom of the incline on the flat surface. Using 2 increases distance by about 20% or 1.5 blocks. All distance trends based on the height seem to be logarithmic. The carts started from rest, on a slope Height blocks up.

Collision
Minecarts are about the same size as a block (1×1). Because of this, a ladder, door, or trapdoor prevents it from falling down a 1×1 hole.

Carts on rails also ignore collision in certain situations. A cart traveling uphill, downhill, or on a curve with a block placed in front of it, goes through the block.

A player or mob riding in a minecart does not collide with or suffocate in any transparent blocks but suffocates inside opaque blocks.

Minecarts are completely unaffected by ice, blue ice, and packed ice.

Minecarts are destroyed in contact with lava or fire.

Mobs
Most mobs can ride minecarts, but only some types of mobs can control them. Mobs cannot exit the minecart unless the minecart is destroyed or moves onto an active activator rail. Endermen, therefore, are unable to teleport out of minecarts.

A mob can ride a minecart by a player placing the minecart under a mob, or by the mob moving into the minecart's space. Some mobs are able to nudge minecarts while in them, like players.

Tamed wolves and cats follow the player when the player rides a minecart.

The player can bump a medium slime in a minecart, rendering it unable to attack. However, a large slime can still attack.

A spider jockey riding a minecart automatically accelerates the minecart.

Mobs in minecarts don't despawn, and don't count towards the mob cap.

Boats
When a boat is placed in a minecart, the minecart travels faster on rails, approximately as fast as on powered rails. The movement in the boat minecart is glitchy and moving forward with the W key moves the cart backward relative to the player, and vice versa for moving backward with the S key. The minecart also moves on the rail-less ground at a crawling speed, but it does not float in the water despite being in a boat.

Using this glitch can be far more resource-efficient since the boat minecart can move at the speed of a powered rail track on flat ground and on slopes. Another physics glitch with the boat minecart is the extreme reduction in friction when the minecart is on rails, which is similar to the lack of friction when a boat is riding on ice. This glitch can be done in survival without cheats simply by pushing a minecart into a boat on the track.

ID




Entity data
Minecarts have entity data associated with them that contain various properties of the entity.




 * See Bedrock Edition level format/Entity format
 * See Bedrock Edition level format/Entity format

Trivia

 * Minecarts appear to float above the track, as their model has no wheels.
 * If the player views their inventory while riding in a minecart, they appear sitting down in mid-air.
 * The player can teleport to another minecart while sitting in a minecart by right-clicking a minecart in their range. This can be used as an elevator to quickly rise up when minecarts are placed on top of each other.
 * If the sound is muted in the options while riding a minecart, and then turned back up, the minecart no longer makes noise in the client until the player exits the minecart.
 * If a saddled pig is riding a minecart, the player can ride the pig. Doing so causes the minecart to be able to ride freely at the player's walking speed. It is unknown whether this is a glitch.
 * It seems that hunger does not deplete while inactive in a minecart (at least in normal difficulty).