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
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 |
tools/tracking
3282661
6
how-to-protect-an-area-in-minecraft-singleplayer-1710
Create an account or sign in to comment.
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