I liked the idea of some of Bukkit's plugins, though, so I'm always trying to find creative ways to get similar results using just the vanilla server. Here's a few tricks I figured out myself or heard about from Reddit.
Upon creating a new world, give yourself a compass and follow it to find the center of the world spawn region. I usually put a block here to visually remind myself where the center is, because the spawn region is important for a couple of reasons.
Firstly, the spawn region is always kept loaded in memory, along with the 5x5 chunk radius surrounding the spawn point (where a chunk is a 16x16 block section of the world). This is important because it means that if you set up any Redstone devices that run on a loop, they'll run all the time even if all the players wander far away from the spawn area. So it's a good place to incorporate command block circuits to enforce global "rules" on your server.
The other important thing is the spawn protection radius, which is the number of blocks around the spawn point (where the compass points) in which non-operator players are not allowed to place or destroy blocks, or interact with most items. By default the radius is set to 16 blocks, and is configurable in the server.properties
file.
In the spawn protection radius, non-op players can't place or destroy blocks, and they can't use any devices except for pressure plates and trip wires. They can't even open or close wooden doors, they can't use crafting tables or furnaces, etc. Only the server operators have rights in the protection radius.
However, the protected area is not safe from monsters or outside interference, so for example if a player lures a Creeper into the spawn region it can still blow up blocks (unless you turn off mob griefing with /gamerule mobGriefing off
, which prevents Creepers and other mobs from changing blocks). Clever players can also fling TNT in from outside the protected region to destroy blocks inside. When in doubt, encase your Redstone circuits in bedrock bunkers and keep them hidden away from view. ;)
/clear @a minecraft:tnt
.All your command block redstone circuits should use a clock circuit of some kind (one that will run in an infinite loop). Ideally, the circuit should be self-starting, especially if the circuit is NOT within the 5x5 chunk spawn radius. This is because when the chunks that contain a redstone circuit are unloaded, the circuit stops running, and when the chunks are reloaded (because a player walks closer to them), you want your circuit to automatically start back up.
See clock circuits for some ideas. An example I use is where you have a redstone torch that powers a circuit, and the circuit eventually extends a piston over an earlier part of the circuit to interrupt its own power. With the power interrupted, the piston retracts, allowing the circuit to be powered again by the redstone torch, and so on.
Outside the spawn region, a useful tip I saw on Reddit is to apply the Mining Fatigue V effect to all players within a certain radius of your building. For example, create a redstone clock near the middle of your building that runs a command block to run this command:
/effect @a[r=60,m=0] 4 3 5This will apply an affect to all players (
@a
), who are within 60 blocks of the command block and who are in Survival Mode (m=0
), the Mining Fatigue effect (ID 4), for 3 seconds, at level 5. Mining Fatigue level 5 basically makes it 100% impossible for the player to mine a block, even if they have a diamond pickaxe, even if it's enchanted. The player can't even break a flower under this condition.The 3 second interval would be adjusted depending on how frequently your clock runs the command. You want it to only affect players while they're within the general area of your building, and lift the effect quickly if they leave.
On one of my servers, I wanted all players to appear in the center of a room when they joined the server (or died without a bed) so that I could somewhat randomly disperse them around the world by having them pick a pressure plate that would teleport them somewhere. See my blog post "Fun with Command Blocks".
Basically, if you go this route, the actual world spawn point will not be used. Instead you'll just have a command block running on a clock that teleports anyone who appears in the spawn region to a destination somewhere else (you should make sure you teleport them far away from the spawn region, so that they'll be outside the radius of the command block that teleported them... otherwise you get caught in an infinite loop of teleportation!)
Example command for this command block to run:
/tp @a[m=0,r=25] X Y ZSubstitute X, Y and Z for the coordinates to teleport to. This command would snipe all users within a 25 block radius of the command block and teleport them off to those coordinates. Also make sure to include the "
m=0
" -- this will make it only teleport Survival Mode players away. This way, you (the operator) can switch your mode to Creative and be able to get close enough to the command block to edit it or whatever you need to do. But it will keep all the other players away by teleporting them to your designated "spawn location".
What I did was encased the End Dimension Spawn Platform in bedrock, with the only exits to either go back through the Exit Portal, or step on a pressure plate that would teleport them into the Parkour course (if somebody destroys the pressure plate, then nobody can get into the parkour course, but it's better than allowing them to vandalize the course itself).
The pressure plate would run a few command blocks - one would clear all their inventory with /clear
, another one would change their game mode to Adventure with /gamemode 2 @p
, and the last one would finally teleport them into the course.
A command block clock in the overworld would set all adventure mode players back to survival in case they died and respawned, with /gamemode 0 @a[m=2]
.
The thing to know about Adventure Mode, though, is that it's basically "Strict" Survival Mode. If a block requires a specific class of tool to break it (stone needs a pickaxe, wood needs an axe), then only that tool is allowed to be used. If you swing an axe at stone, or a pickaxe at dirt, then your player just swings once as if hitting air, and then nothing.
You don't necessarily need to use the right material of tool, just the right tool. For example Adventure Mode allows you to destroy obsidian using a wooden pickaxe, even though the wooden pickaxe won't drop the obsidian block. So for Adventure Mode to work, you basically need to remove ALL tools from their inventory.
Even without tools, blocks that can be broken by hand are still vulnerable. So avoid using glass, torches, flowers, redstone devices (including buttons) which are in reach of the player, etc., as they can break these without needing any tools at all.
Update (8/14/15): As of Minecraft 1.8, the Adventure Mode behavior has been changed. Briefly:
/clear
their inventory either!
There are 36 comments on this page. Add yours.
I'm sorry, but i dont understand how to control griefing. Could you tell me step by step. (if you want)
I wrote a more detailed post about griefer control with command blocks here:
http://www.kirsle.net/blog/kirsle/minecraft-anti-griefing-in-vanilla
Do You No How To Do Setup The .spawn Things
Any idea how to set up a couple of basic commands like .spawn or .sethome?
use /setblock [x] [y] [z] minecraft:redstone_block 0 destroy for a redstone clock that goes of every second more than 2 times its the fastest clock ever no need for circuit!
Oh and the x y z cords have to be touching the command block for instace ~ ~1 ~ or ~1 ~ ~ or ~ ~ ~1 and so on
That produces an insane number of redstone block item drops. Is there a way to do it that doesn't result in drops? (/gamerule doTileDrops false
not being a good option)
Command: setblock ~1 ~ ~ minecraft:redstone_block 0 destroy
I found a way of doing this that involves two command blocks (I believe this is the way most people do it but I figured it out myself as well)...
It kinda exploits the order in which Minecraft processes command blocks, though, i.e. you have to put them in the correct order (X/Y/Z coordinates-wise).
You have two command blocks with one empty space between them, like
[X] [_] [X]
(the empty space can be vertical as well, probably)
One command block sets that empty space to be a redstone block; the other sets the space to be air (or, anything that's NOT a redstone block, maybe).
Like:
setblock ~1 ~ ~ minecraft:redstone_block 0 replace
setblock ~-1 ~ ~ minecraft:air 0 replace
Then place a redstone block between the two to start the process. If the redstone block you place disappears and never comes back, the command blocks are in the wrong order, and you should swap their commands (and be sure to fix the X/Y/Z coordinates to be opposites as well, in this example, the redstone_block uses ~-1
instead of ~1
and the same for the air block).
When it works, the redstone block appears to stay in place forever.
Like I said, this exploits the ordering in which the game processes command blocks. If the game ever switches order in a future update, or if they multi-thread the command blocks, this clock may break.
But basically, when you place the redstone block between the command blocks, you power both blocks at exactly the same time, but the game can't run both of their commands at exactly the same time, so it does them in a certain order (I don't know the order off-hand, but logically it would be, the block with the lower numbers in the X, Y, Z coordinates is run first).
So the first command block runs, and replaces the redstone block with air. Then the game still has to execute the other command block (since it was powered, even though "now" it isn't), and this block puts the redstone block back where it was originally. End of game tick.
Then the game's like, "oh, redstone block here, power the command blocks! First one, then the other" and so on.
If the blocks are in the wrong order (i.e. the one that replaces with redstone runs first).... player places Redstone, command block 1 puts Redstone there (no net effect), command block 2 puts Air there. End of tick. Now there is no redstone block, and the command blocks don't get run again.
I use this for clocks too. But I replace stone instead of air so I can turn the commands on and off easy when testing. Just break the redstone and the updating stops. Put a stone block back and it starts again.
Clock top: /fill ~ ~-1 ~ ~ ~-1 ~10 redstone_block 0 replace stone Clock Bottom: /fill ~ ~1 ~ ~ ~1 ~10 stone 0 replace redstone_block
This makes a 10 block long clock in the +Z direction
The server processes command blocks along the x axis
first then y axis highest to lowest. (this is in reference to the commandblock clock mentioned in the post. which is very handy since it eliminates block/chunk updates and reduces lag)
We're running a vanilla build, 1.8, on a linux host, in creative only.. for a group of young crafters. How can I offer the players the option to protect their creations from damage from the inexperienced/etc, without modding?
Thanks in advance!!
Without mods I think the only way would be to turn the server into survival or adventure and then give creative mode at assigned areas. Each player would have an area for creative mode and when outside of that switch to a different mode. /gamemode 1 @p[r=30,name=Steve_Digs] Or, all players but one get switched to adventure mode in a specified area. /gamemode 2 @a[r=30,name=!Steve_Digs]
Put this command in a command block (above ground)
/setblock ~ ~ ~ mob_spawner 0 replace {EntityId:Zombie,SpawnRange:6,RequiredPlayerRange:12,SpawnCount:1,MaxNearbyEntities:6,MinSpawnDelay:100,MaxSpawnDelay:600,SpawnData:{Equipment:[{id:268,Count:1},{id:301,Count:1}{id:300,Count:1,tag:{display:{color:5013401}}},{id:299,Count:1,tag:{display:{color:6717235}}{id:397,Count:1,Damage:3,tag:{SkullOwner:}}]},SpawnPotentials:[ {Type:Zombie,Weight:4,Properties:{Equipment:{id:268,Count:1,Damage:58},{id:301,Count:1{id:300,Count:1,tag:{display:{color:5013401}}},{id:299,Count:1,tag:{display:{color:6717235}}{id:397,Count:1,Damage:3,tag:{SkullOwner:}}]}}, {Type:Skeleton,Weight:2,Propertie{Equipment:[{id:267},{id:301,Count:1,tag:{display:{color:1644825}}},{id:300,Count:1,tag:{displa{color:1644825}}},{id:299,Count:1,tag:{display:{color:1644825}}},{id:397,Count:1,Damage:3,ta{SkullOwner:}}]}}, {Type:Zombie,Weight:4,Properties:{Equipment:[{id:272,Count:1},{id:305,Count:1},{id:304,Count:1}{id:303,Count:1},{id:397,Count:1,Damage:3,tag:{ench:{id:0,lvl:2}],SkullOwner:}}]}}, {Type:Zombie,Weight:4,Properties:{Fire:2400,Equipment[{id:283,Count:1,tag:{ench:{id:20,lvl:1}]}}{id:317,Count:1},{id:316,Count:1},{id:315,Count:1}{id:86,Count:1,tag:{ench:[{id:0,lvl:2}{id:1,lvl:10}]}}]}}, {Type:Zombie,Weight:4,Properties:{Equipmen[{id:267,Count:1,tag:{ench:{id:16,lvl:2}]}}{id:309,Count:1},{id:308,Count:1},{id:307,Count:1}{id:397,Count:1,Damage:3,tag:{ench[{id:0,lvl:2}],SkullOwner:}}]}}{Type:Zombie,Weight:1,Properties:{Equipment:[{id:278,Count:1,tag:{ench:{id:16,lvl:4},{id:17,lvl:4{id:18,lvl:4},{id:21,lvl:3},{id:34,lvl:3}]}},{id:313,Count:1,tag:{ench:[{id:1,lvl:4},{id:2,lvl:4}]}}{id:312,Count:1,tag:{ench:[{id:3,lvl:4}]}},{id:311,Count:1,tag:{ench:[{id:0,lvl:4}]}}{id:397,Count:1,Damage:3,tag:{SkullOwner:,ench:[{id:0,lvl:4},{id:1,lvl:4},{id:3,lvl:4}{id:5,lvl:3},{id:6,lvl:1}]}}],CustomNameVisible:1,CustomName:Herobrine,PersistenceRequired:1}}, ]}
Activate the command block with a button
How do i have the command block keep the command after i break it??
You don't. The command block item (in your inventory) doesn't keep its NBT tags. Those are only for the placed block.
Can i join your server? I just started my own vanilla one too. Your tips work and i love them!
What's the command for this;;
Your making a custom map. It's in survival/ adventure. You don't want to have that people are cheating with their gamemode. Whats the commandblock(s) command(s) for that if people say; /gamemode 1 / /gamemode creative ?
Curious how to keep players from placing blocks in the pseudo spawn area. I have them spawn going to one point and they can't break blocks. But they can still place blocks.
Any Ideas???
BTW this is the most helpful site for vanilla. Thanks
In adventure mode players can't place blocks either, unless the block item has an explicit CanPlaceOn
flag set.
Edit: as of Minecraft 1.8
Kisle,
I can change them in and out of adventure mode but how do I include or exclude groups such as staff??? We are already using scoreboard and that only allows for players to be on one team I think.
Thunder
You might be able to use scoreboard objectives and apply those to the individual players rather than teams.
/scoreboard objectives add staff dummy Staff
/scoreboard players set <name> staff 1
Repeat the second command for each staff user.
And in the command block selector,
/gamemode 2 @a[r=30,score_staff_min=1]
I love you
I created total LAG!!!!!!!!! Created a block made of anything you want and seirowd it with tnt an put the command in the command block and put an iron door in front of the presser plate and Derum role plz? guess what... LAGGGGGGGGGGGGG!!!!!!!!!!
i cant use any command in a world in multiplayer
On multiplayer you have to be a server operator to use command blocks (because you have to be an op to use commands at all).
Kirsle
Im making a server and what is the command to welcome someone to the server with their name in the message so everyone knoes that they're online. I want the message to go to everyone
Well, this page was named "Vanilla Minecraft Tricks" so i was wondering if you can give me a hand on particicles, (like having it revolving around players, out of blocks, and such)
hi, I was just wondering, is there a command that you can use, either with comm blocks or after pressing / that makes certain or all entity names permanently visible no matter where you look or how far away you are? of course, I'd like to have them fade the further away you get, as I'm assuming this may reduce lag.
My world burn - how can i remove the fire for a second?
is there a way to make it that when a player spawns on LAN it activates redstone (to set of a title)
You could do that on their first spawn by using scoreboard objectives. Something like...
1) Make a dummy objective named "spawned" or something:
/scoreboard objectives add spawned dummy Spawned
2) Make a redstone clock at your spawn area that repeatedly powers a command block that checks for users that don't have this point:
testfor @a[!score_spawned=1]
When this command block's output is true (i.e. it detected a player whose "spawned" score is not 1), the block itself will output a redstone signal.
3) On the other side of the block (away from the side that gave it power), run some redstone dust over a couple more command blocks:
tell @a[!score_spawned=1] Welcome to the server!
scoreboard players add @a[!score_spawned=1] spawned 1
These blocks would show the welcome message to the newly spawned user and then set their spawned
score to 1 (so that the command blocks won't match that user again in the future).
This all will cover newly joining players who connect for the first time. If they return to the same server later, they'll still have the spawned=1 score and not be greeted again (there isn't an "on spawn" handler you can use directly, so messing with scoreboards is the only way to do this afaik).
There's also statistics you can try, but none are very useful for this... the best being stat.timeSinceDeath
which resets every time the player dies and presumably begins at 0 when they first spawn... but you'd end up showing the welcome message on every respawn even after dying.
Relevant links:
How do you attach a command to a certain key on your computer so that you can press that button to activate the command
How do you keep from hackers?
hahahah. I learn this from a site: (i forgot the site XD) if you want to make an adventure map that no one can cheat in it when you are creating the world dont allow cheats and keep gamemode 0. once you entered new world go open to lan allow cheats on and start and now you can cheat and make your map and at the end go to default gamemode and restart your map and it will disallow cheats again I HOPE IT HELPED but other players can cheat in your map in the same way lololol
To protect the spawn from tnt cannons use a command block who kill any ignited tnt entity with a radius. Also kill creepers To counter hackers use a command block to teleport players with more than a certain flying score, (reset it when the player jump) to an encased bedrock jail and set his spawn point there, give them a special objective dummy and make a command to teleport them back(clock) because hackers can scape. Then when you log in just ban them. Search for anty fly hack in google For anti pvp at spawn use potion effects: resistance 4 and weakness 4. Trick: the fastest way to execute two command blocks at the same time is powering one and placeing the other above
pigs
0.0080s
.