I want to /give myself a commandblock minecart that already has a command in it. I already tried using the {BlockEntityTag} in the /give command but that didn't work.

/give @p minecraft:command_block_minecart 1 0 {BlockEntityData:{Command:/say hi}}

Anyone know how to do this?

3 Answers 3


BlockEntityTag is to store potential tile entity data, while minecarts are regular entities. While armor stands and spawn eggs support the usage of the EntityTag compound, minecarts do not.

Your only option would be to rename the minecart and use an external command block to modify minecarts with that name (as the name is transferred as the CustomName on the entity):

/give @p minecraft:command_block_minecart 1 0 {display:{Name:"replace"}}

/entitydata @e[type=MinecartCommandBlock,name=replace] {CustomName:"",Command:"/say hi"}

Use /entitydata @e[name=replace] {CustomName:"",Command:"/say hi"} as the other command no longer works this new command will only work on already placed command block mine-carts.


Oh that's easy, here's a force op minecart command, just change the command around:

/give @p minecraft:wither_skeleton_spawn_egg{EntityTag:{Command:"/execute as @e run op InsertUsername",CustomName:'{"text":"Force Op Lmao"}',id:"minecraft:command_block_minecart"},display:{Name:'{"text":"Force Op Lmao"}'}}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .