Wiki ArticleLocal entity data availableNon-renewable resourcesNon-stackable resourcesPages with sound tablesPages with Java sound tables

Minecart with Command Block

A minecart with command block is an impulse or repeating command block inside a minecart.

Local game data

Minecart with Command Block

Java 1.21.4
Typeitem
Stack1
Durability-
Sections4
Canonical IDitem:command_block_minecart
Minecraft IDminecraft:command_block_minecart
Wiki sourcecached

A minecart with command block is an impulse or repeating command block inside a minecart.

Obtaining

The minecart with command block is obtainable only using the command , as it does not appear in the creative inventory and has no crafting recipe. It can also be summoned using the command . It can be broken like any other minecart, but only the minecart is retained, while the command block is lost. Unlike most minecart types, command block minecarts can't be crafted with a minecart and a command block.

Usage

The minecart with command block combines the functionalities of both minecarts and command blocks. Although the minecart visually contains an impulse command block in Java Edition, it functions more similarly to a repeating command block, executing the command once every four game ticks (unlike a repeating command block that repeats every 1 game tick) when on an active activator rail. When it passes over a detector rail with a comparator connected next to it, it outputs the command block's success count value. The command is executed at the coordinates of the minecart, which can of course move, allowing for command execution relative to an entity without the command.

Entity data

Minecarts with command blocks have entity data associated with them that contain various properties of the entity. :

: The command entered into the minecart. : The last line of output generated by the minecart. Still stored even if the gamerule commandBlockOutput is false. Appears in the GUI of the minecart when right-clicked, and includes a timestamp of when the output was produced. : Represents the strength of the analog signal output by redstone comparators attached to this minecart. Only updated when the minecart is activated with an activator rail. : or (/) - Determines whether the LastOutput is stored. Can be toggled in the GUI by clicking a button near the "Previous Output" textbox. Caption on the button indicates current state: "O" if true,"X" if false.

: See Bedrock Edition level format/Entity format.

Screenshots

Minecart with command block 13w39b.png|A minecart with command block in 1.16.4. Red bucket with air.png|A minecart command block testing the block in the red area with air.

Local Data Properties

displayNameMinecart with Command Block
namecommand_block_minecart
id1182
stackSize1