Minecraft Blogs / Article

How to protect an area in Minecraft Singleplayer [1.7.10]

  • 1,827 views, 1 today
  • 1
  • 0
  • 3
RexCreations's Avatar RexCreations
Level 7 : Apprentice Explorer
1
Are you sick of people entering your house or area? Then keep on reading!

Step 1 - Obtain the Command Block
I use item IDs. If you are on Minecraft 1.8.x use minecraft:command_block

Load your world and then when the loading is finished, press the / key on your keyboard. Then, type the following command:
/give <your minecraft playername> 137 1


This will give you a command block. If you are on a server, please stop reading and look for another guide out there. This article is for Singleplayer, as I described at the beginning.

Step 2 - Type the command

Place the command block and click it. Type the following command on the command block:
tp @a[r=<radius of your area/house>] ~-10 ~+10 ~-10

Replace <radius of your area/house> with the radius of your area. Example: tp @a[r=10] ~-10 ~+10 ~-10.
Now, create a redstone loop that will keep activating the command block. This is needed to keep out other players all the time.
TIP: If you want, replace @a with a specific player.

That's it! Please feel free to comment on this article and I will improve for next time :).
 - RexCreations
Tags

Create an account or sign in to comment.

1
04/04/2015 10:59 am
Level 13 : Journeyman Pokemon
sam112
sam112's Avatar
Or you could just go in creative and surround your house with bedrock
1
04/04/2015 7:32 am
Level 9 : Apprentice Modder
Destian_
Destian_'s Avatar
That throws out all players from the specified area. Try @a[r=<radius of area>,name=!<YourName>] instead.
And a /tp command isn't really great for protection...

Try to use the following command instead:
/gamemode 2* @a[r=<radius of area>,name**=!<YourName>]  
*or 3 - if you want them to be in spectator mode
** instead of a name you could also make a team using scoreboard

And don't forget to use another command block:
/gamemode 0 @a[rm=<radius of area + 1>]
 This sets every player that isn't inside the radius of the first command block back to survival mode

And to get rid of the "Your gamemode has been changed" message you should add 'm=<gamemode>' to the selector. For example:
/gamemode 0 @a[rm=<radius of area + 1>,m=2]
The gamemode of every player who isn't in the protected area AND is in adventure mode is set to survival
1
04/06/2015 9:10 am
Level 7 : Apprentice Explorer
RexCreations
RexCreations's Avatar
Thanks for the feedback :). It is really helpful to me :).
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome