
Hey everybody, it’s UnderMyCap, and welcome back to another video! Today, I’m going to show you how to make a locked chest in Minecraft Java Edition. This method doesn’t require any mods or data packs—just one single command, which is super cool! Right here, you can see I have a regular-looking chest, and when I click on it, I can’t open it. It says the chest is locked. The really cool thing about this is that you don’t have to be in Creative or Survival mode. I’ll switch to Survival mode now. To open the chest, you need to have a specially named key in your hand. You can see I’m in Survival mode, and I can’t open this chest without the key. Now you might be thinking, “UnderMyCap, that looks so hard to make,” but honestly, it’s just one single command. Let’s get straight into how to do it! First of all, I’m going to go into Creative mode, and you need to make sure that cheats are enabled on your world. If you don’t have cheats enabled automatically when setting up, you simply have to open to LAN, click “Allow Cheats,” and hit “Start LAN World.” Since I already have cheats enabled, I won’t do that again. First, you want to place down a regular chest. This is a normal chest; nothing is different about it. Now, you need to type in a special command. Please take note that when you do this command, you have to make your character stare at the block. You can see that my character is staring at the block, and we need to go into the command line. I’ll explain later why you need to do this, but first, we’ll want to type in the following command: /data merge block Now we can autofill. This is where staring at the block comes in! You’ll notice all these numbers pop up; these numbers are actually the coordinates of the block we’re staring at. We need to make sure that we’re merging the data with the block we’re focused on. After this, the simple part is typing in: lock: “your_password_here” Now you can write whatever password you like for the lock, such as “hello this is a key.” You really don’t need underscores; you can have it all together. Just make sure you have the quotation marks. Once I hit Enter, it will say “modified block data,” and you’ll see that I actually cannot open this chest. It makes a door noise when I try. Now you’re probably wondering how to get the key, and it’s super simple. All you have to do is pull out an anvil, place it on the ground, and pick an item you want your key to be. For example, let’s use a water bottle. That’s a random item I just thought of! Type in the exact same thing as before—make sure to keep any spaces or underscores you initially included. I’ll type in “hello this is a key” again, and now you’ll notice that I can open the chest. I’m not sure if this works for other containers as well, so let’s try a shulker box. Interesting! Okay, it works for the shulker box too; I can only open it with this key. Unfortunately, if you break this block, it will drop all of its items and unlock itself. A player could come along and break it to get all the items in it. So unless a player doesn’t know that this is how it works, they can’t access it. If the world is in Adventure mode, then they won’t be able to access it without the key, which I think is pretty cool. Unfortunately, this command doesn’t work on Bedrock Edition. I’m really sorry if you hoped it would work there; I really don’t think it’s possible at the moment. If you enjoyed the video, don’t forget to leave a like and subscribe to the channel! I’ve made a whole bunch of new videos for the new world update, so if you want to see that, I’ve added a playlist right here. If you want to see the best recommended video on my channel for you, then hit this button up here. Thank you so much for watching! The sun is setting, so once again, thank you, and I can’t wait to see you in the next video. See ya!
This post has used AI to generate and enhance content