This is the best way to stop your friend from being annoying. Or the best way to be annoying and put them in here.
Step 1: Let's Get Started
What you will need is: 41 blocks of whatever you like (I used obsidian), one Redstone repeater, one Redstone comparator, two hoppers and three command blocks (I know it's actually cheating but this is just really good so...). To get a command block type in: /give your name 137. So I would type in: /give Alpha 137.
Step 2: Building
Make a 5x5 square using whatever you are using, leaving a 3x3 square in in the middle. After that make the outer square one layer higher and take out the 3x3 square in the middle and fill it with your preferred block.
Step 3: Command Blocks
Place three command blocks in front of the prison. Put the Redstone, Redstone repeater and Redstone comparator as shown. To put Redstone on the command blocks just hold shift and place your great red substance.
Step 4: Command Blocks
Stand insides the prison and click f3 to show your coordinates. Write down your x,y and z coordinates somewhere. Now in the middle command block type: tp name of the player that you want to imprison x,y and z coordinates. So for me it would be: tp Alex 939.5 56 290.5. (make sure that x is first, then y and then z) Round the coordinates to a whole number or a half. The rounding doesn't have to be super accurate. In the left command block write: gamemode adventure name of the person. For me it would be: gamemode adventure Alex. In the last command block type in: clear name of the person. So for me: clear Alex. That was the coding.
Step 5: The Hoppers
This part is a bit complicated but I'll try my best to explain it well. Stand facing the prison and place one hopper behind the comparator. Now stand behind this hopper, still facing the prison, and aiming at the last hopper that you place, hold shift and place another hopper. After that destroy the first hopper that you placed and stand on top of the Redstone comparator. Now aiming at the last hopper that you place hold shift again and place another hopper. It should look like in the second picture.
Step 6: Have Fun!
Now place ONE item in one of the hoppers and put your friend at your mercy. Thank you for reading this and I hope this comes in usefully. I myself am having a lot of fun putting my friends in this prison. Thank you again, please quickly comment and vote and have a nice day.