How to make Minecart Chests unmovable
I'm tying to make hidden chests in Minecraft. I found this code:
/summon MinecartChest ~ ~-1 ~.05 {CustomName:"Hidden Chest"}
Which summons a Minecart Chest In the block beneath [whoever's using the command]. So when you right click on it, it opens the Minecart Chest, with the name "Hidden Chest".
But there's a problem: If you go really close to the block (in particular, step on top of it), the Minecart is inside of the block moves downwards thus making it impossible to open it without breaking blocks.
I wonder if there's any way to prevent this?
Can I make it with the NoAI NBT tag? I tried to spawn a skeleton without an AI, and then I couldn't move it. But, when I tried to summon the Minecart Chest without AI, but it didn't work. (Of course, Minecarts have no AI in the first place).
Best Answer
Try summoning a Minecart Chest riding placeholder entity.
/summon MinecartChest ~ ~-1 ~ {CustomName:"Hidden Chest",Riding:{id:Chicken,Invulnerable:1,NoAI:1,Silent:1,Age:-2147483648,ActiveEffects:[{Id:14,Amplifier:0,Duration:2147483647,ShowParticles:0b}]}}
Note: This command is too long to paste into chat, use command block instead.
Added information about Invincibility - See Making mobs invincible (David Toh's solution for more details) and http://minecraft.gamepedia.com/Chunk_format#Entity_format.
Pictures about "How to make Minecart Chests unmovable"



How do you make a hidden minecart chest?
First, you dig a hole, and fill it with 3 snow layers. Then, force a minecart with chest to fall in the hole. Now, with pistons, make a tree over the minecart chest. Now, test it- right-click the bottom of your tree.How do you make a minecart with chest move when full?
Minecarts almost always despawn. For a normal minecart, whether a mob or a player is riding on it or not is not relevant to the result. Note that this is not a rollback issue (MCPE-12347). Minecarts despawn even if there are newer changes to the chunk which are correctly auto-saved before crashing.Can a minecart with a chest Despawn?
The crafting recipe for a minecart with chest is now shapeless. Breaking a minecart with chest will now drop the item instead of the minecart and chest separately, though the contents of the chest are still dropped. Added minecarts with chests.✔ Minecraft: How to make an Automatic Item Transfer System
More answers regarding how to make Minecart Chests unmovable
Answer 2
You can do this by summoning an armor stand with a minecart chest as its passenger:
/summon armor_stand ~ ~ ~ {Invisible:1b,Marker:1b,Passengers:[{id:"minecraft:chest_minecart",CustomName:"{\"text\":\"Hidden Chest\"}"}]}
This is the command as updated for Minecraft version 1.13. Previously (prior to 1.9), this command was reversed; /summon chest_minecart ~ ~ ~ {Riding:{id:armor_stand}}. The Riding NBT tag was changed to Passengers in 1.9. A really cool resource to help you build these kinds of commands, which I used for this updated answer, is https://mcstacker.net/
Answer 3
Stick this in a command block set up with a 'setblock' or 'fill' clock:
entitydata @e[(stuff to identify the right minecart)] {Motion:[0:0d,1:0.03999999910593d,2:0d]}
The minecart will be stuck WHEREVER you put it. It's given a constant motion of no north/south, no east/west, and a tiny upward motion (to counteract gravity if it's in the air). Don't worry, even if it's on the ground, it will stay EXACTLY where you put it. Have fun with this!
EDIT: Make sure to put this in a spawn chunk or within two chunks of where it's being used. If not, it could stop working and the MinecartChest, or whatever other minecart, would become normal and move around.
Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.
Images: Yan Krukov, Anna Shvets, Monstera, Andrea Piacquadio
