HomeКомпьютерные игрыRelated VideosMore From: CrushedPixel

Minecraft - How to remove lag from Command Blocks

857 ratings | 17606 views
In this video I explain why Fill Clocks cause Server Lag and how Mapmakers can prevent this from happening. For another video on the "63 Block Limit", watch this video by samasaurus6: https://www.youtube.com/watch?v=KsIN5LeofcY Donate here: http://bit.ly/DonorCP | http://patreon.com/CrushedPixel ==============================­======== As always, leaving a like makes me happy :) Twitter: https://twitter.com/CrushedPixel Replay Mod Website: http://replaymod.com
Html code for embedding videos on your blog
Text Comments (175)
Inaros (1 year ago)
Sounds correct to me ..... You're amazing. Now I guess I can use A LOT of one command creations! Thnx Again!
Lai yin Tam (1 year ago)
Hey help sometime when I'm far away form the command block then it will not working
KChicken (1 year ago)
Doing a simple /setworldspawn command where all of the command blocks are can fix this by resetting the spawn chunk to your location
Ephrius Hornetstaff (1 year ago)
+Lai yin Tam Apparently so, but as far as I know, the most important thing for your issue is that the command blocks should be in the spawn chunks so they don't get unloaded. But if you're making an adventure map, the way I understand it is that you should have the actual play area be far away from the spawn chunks, which should have command blocks that do stuff based on scores and such, rather than player location. When I'm making, say, a dungeon in a large map, I'll have the command blocks -for that dungeon- below the floor, and not anywhere near the spawn chunks, and it works fine. Hope my explanation wasn't too confusing.
Lai yin Tam (1 year ago)
but that video say i need go far!!!!!!!!!!!!!!!!!!!!!! im so confused!!!!!!! help 111111111!!!!!!!!!!!111
Ephrius Hornetstaff (1 year ago)
The chunks your command blocks are in are unloaded because you're too far away. If you place the command blocks in the chunks near the world spawn, they'll always be loaded, and your issue shouldn't happen anymore. Hope I helped!
TheMinecraftNerd (2 years ago)
This limit doesn't even matter anymore. 5 to 6 fill clocks are enough to lag down a huge server in the 1.9 update, even if they are in separate chunks.
link map
UviPL (2 years ago)
So why some Mapmakers make mechanisms with lots of command blocks and it's not lagging ?
TiTanAEfull (2 years ago)
i have a line of redstone blocks in a chunk beeing replaced 20 times a sec. on them, are less than 60 command blocks getting powered 20 times a sec. are there redstone blocks counted as block updates? if so, are they causing a higher memory usage (and therefore lag) when running? concidering all the 60~ command blocks i have arround them? if so, then there are more than 64 blocks getting updated.
Frostbite1003 (2 years ago)
Is this also the case for the single player server? I'm working on a kind of "game engine" inside Minecraft and it uses a huge amount of command blocks. I'm using the new chain and repeat blocks from the snapshots. Do you know if these Updates are transmitted as well?
bleuthoot (2 years ago)
How about command block powered servers, same rules?
쇼임TV (2 years ago)
Myren Eario (2 years ago)
Chunk data packets can also be used to get rid of ghost blocks in a 16x16x16 section. Interesting to see that packets are relevant for command block technology.
Kazz (2 years ago)
How to load chunk where I placed command blocks 1000 blocks away from players on server ?
Nepew (2 years ago)
I actually found out about this before, didn't know why it's happening though.Now I know, thanks =D
MCCreeper master (2 years ago)
U are the best I thought it didn't work but turns out it did thanx so much 10000 thumbs up u derserve it;)
- SD2 - (2 years ago)
i lieked
Vrail Nightviper (2 years ago)
What about a map that I need more than 63 commands running constantly?
Sfp70 Technology (2 years ago)
I dont know, but maybye having 300 command blocks in 1 chunk might have lagged me out, *alot*...
2buildornot2build (2 years ago)
This is actually really helpful!
DDGamerSeeker (2 years ago)
IQ TEST 1. This roman numeral is 9, turn it into six just by adding a single line. Q: IX 2. This equation is definitely wrong. How to correct it without changing it?? Q: XI + I = X 3. The day after the day after tomorrow is four days before Monday. What day is it today? 4. Forest is to tree as tree is to? 5. There are 17 pigeons sitting in a row on a wall. A boy shoots the fifth pigeon. How many pigeons remain? 6. Little John has a habit of throwing things whenever he gets angry. One day he throws a toy of his and it again comes back to him without bouncing off anything. How did this happen? 7. Find the odd one out: level, civic, madam, eye, mouth A: Mouth 8. Use the word "dormitory" to make two words which will complete the below sentence. Daniel stays in a _______ _______. Answers with explanation: 1. SIX 2. Turn it upside down so it makes the equation correct. 3. Monday - Four days before Monday is Thursday, simply because four days after Thursday is Monday. Besides, day after the day after tomorrow is Thursday only if present day is Monday. 4. Leaf - As forest houses several trees, a tree has many leaves. Branches is a close choice but it is incorrect as all tress do not have branches. 5. None - all pigeons fly because of the sound of the gun shot. 6. John had thrown the toy straight up in the air. 7. Mouth - All the words except "mouth" are palindromes (reads the same backward and forward). 8. Dirty Room
Dingusbread44 (2 years ago)
I can't create an account on the Replaymod website :(
Adrodoc (2 years ago)
I wonder what is the benefit of programming minecraft like this. The way you present it, it just seems like a bad implementation. If chunk packages are that inefficient, why would they send chunk packages at all, other than when you load completely new chunks?
CrushedPixel (2 years ago)
+Adrodoc55 I assume that back in the days when Notch created the server/client code, he never thought of commands like /fill to change bulks of blocks at the same time, and Dinnerbone etc who implemented those features didn't update the server code accordingly.
PucciFX (2 years ago)
Lol are you German?
VonDreakenSteyn (2 years ago)
(Just an idea:) What about using just 1 chunk for the clocks (with vertical clocks). That way the server only has to send 1 chunk data package every tick instead of multiple smaller data packages. Would that work?
Hynek Chovan (2 years ago)
I' d like to make it faster then you.
Hynek Chovan (2 years ago)
Chalange: make a vanilla minecraft pipes, but bot from hoppers
Adam Eason (2 years ago)
when might we get a beta of the replay mod???
NeoMc (2 years ago)
So using persistent mobs around redstone that is 1000 blocks away from players I can eliminate lag?
DjKripermaster 14 (2 years ago)
I understand nothing but i like VID
Eren Kızılırmak (2 years ago)
Hey ı have a challence for you! Can you make new mobs ?!
Craftronix (2 years ago)
never heard about command blocks :/ but looks like useful stuff..^^
minindo (2 years ago)
+Craftronix Uhhh... iPhone, road sign, other stuff ring a bell?
Lol yeah.. you totally know nothing.. cough Iphone cough
xXPotatoGamerXx (2 years ago)
+Craftronix omg hi craftronix i love your iphone!
Adrian Schmidt (2 years ago)
At thhe end you say: If you found it.... But that's german. You have to say: If you liked it
Kasper S. (2 years ago)
I already knew of the 63-limit rule, but never knew why it happened. Thanks for explaining this so good (even though you forgot something which many people have already pointed out)
Durchblick (2 years ago)
Good to know!
Marcus Hamelink (2 years ago)
Hey CP I know it's probably complicated for you but be careful with the numbers you say because in English we say 256 like this: two hundred and fifty six. Not two hundred and sixty five! Just saying
Max Phillips (2 years ago)
What's the status on the replay mod? Can't wait for the release :D
Gaming Zer0 (2 years ago)
Thanks so much once again you have helped me BTW you said you're making a Medieval PVP map what happened to it?
Hii FourEightEight (2 years ago)
What would happen if you placed all of your command blocks into a single chunk? That would then only send a single chunk packet right? Although that's a lot bigger than multiblock packets, if I had enough command blocks to fill up the entire chunk, would this be more effective? Or even if it was half the chunk completely filled with commands, or would that still be better to spread around?
Pablete12 (2 years ago)
This should also apply to /fill and /clone commands, even you usually don't make them 20 times/sec, if you do fill and clone commands under 63 blocks you prevent a small lag spike client-side
TheEiscremeMaster (2 years ago)
I have been searching for a solution for my lag problem for ages. I searched the entire internet for something to help me, but the only possible source for that much lag I found were light updates... However this video explains perfectly why the lag happened :) Thank you for the video <3
TheEiscremeMaster (2 years ago)
entereloaded (2 years ago)
Vayu - Game Developer (2 years ago)
Nice Video, thx
hugo 4715 (2 years ago)
I think we can modify the server to cancel these packet from being sent with a server-side mod. It could reduce lag by a thousand on some maps.
Paul Wesley (2 years ago)
+CrushedPixel So das nennt man Clocking Limit btw ;) Und dazu gehören nicht nur die CommandBlöcke sondern auch die RedstoneBlöcke bei ner Fill Clock, heißt nicht mehr als 63 Command- + RedstoneBlöcke die jeden Tick verändert werden Außerdem sollte man die Clocks nur im 14*14 Centrum benutzen, da sonst am Rand mehr Sachen geupdatet werden. Zudem sollte man keine Redstonedust benutzten, da der für jedes Stärkelevel was er verliert (neben Hebel z.B. von 15 auf 0) alle Blöcke im Umkreis von glaub 12 Blöcken oder so updated heißt redstonedust was jeden tick geupdatet wird führt zu mindestens 20*15*720 Blöcke pro Sekunde geupdatet würden! NEVER USE REDSTONEDUST Zudem gibts Tricks 17*17 Spawnchunks zu bekommen ;) Ich hoffe zu machst nochmal nen Video mit allen guten Tipss hier in den Kommentaren dazu!
Paul Wesley (2 years ago)
+Cheataa doch wird es
J Revv (2 years ago)
my map is located in the spawn chunks along with 129 command blocks. What can I do?
ARRA (2 years ago)
Че этот америкос произнести желал? Объясните в 2х словах -_-
Namno (2 years ago)
If I place all of my Command blocks 1000 Blocks away from the player, would they stil work? The chunks in which they are wouldn`t be loaded I think...
Sascha Bergsma (2 years ago)
65 is pronounced sixty five, not fifty six It might be hard for you because you are german.
Me Its Lars (2 years ago)
Thank you very much, i'll definately follow your rules :D
HuJohner (2 years ago)
Good Job! Very informative, I knew these rules already but where you come from gives a whole new perspective thanks for sharing :)
Ocronomic (2 years ago)
wow you said 265 instead of 256
Amigeo 635 (2 years ago)
I'm your 200th liker
BidoofIsBae (2 years ago)
When is replay mod out?
QwertyuiopThePie (2 years ago)
*cough* *cough* +SethBling (Sorry, never gonna let you live it down.)
Sam van der Kris (2 years ago)
Well, that's song is sticking in my head for the next 8 years... xD
Amar Gandhi (2 years ago)
+CrushedPixel I'm fine. But then again, I have beefy internet. The game itself is too fun to stop playing.
AdityaTD (2 years ago)
+CrushedPixel ikr, I was never able to play it in my life xD
CrushedPixel (2 years ago)
Haha, I too think that Missile Wars is unplayable because of their redstone being at the playfield.
Gandalf From Conick (2 years ago)
I didn't know moving the command blocks away from the player so far affected lag. Thanks! That was really helpful!
Skypit (2 years ago)
nice video :)
megature (2 years ago)
That'll definitely be helpful. I'm thinking of starting work on a map, and this will probably reduce a lot of lag, since I want to make it a big map with a lot of command blocks.
QwertyuiopThePie (2 years ago)
+Cookie Films Definitely follow these rules, then. Also, turn off clocks when not in use. Remember, the 63 block rule only applies to currently active blocks. If you have a set of clocks only one of which will be running at a time, there's no need to worry about it.
Michael Buerger (2 years ago)
This was really interesting! Thanks for making this video. :D
Tanner (2 years ago)
multi block change pikkit
Arthur the Artist (2 years ago)
No wonder mcmakisteins snakes was laggy
Dank Chowder (2 years ago)
crushedpixel your a genius. now ik how to not kill my computer XD
tmbocheeko (2 years ago)
Nice work with this! It'll help me and my friends, since we play vanilla UHC with custom game modes (not even going to try to explain what those are, but for those of you know what ur is, we have moles, cutclean, golden heads, and some basic things that plugins usually do) that take up a LOT more than 63 updates per tick. Since I have all of the heavy ones in one-conmand-block forms, it's easy to spread them out enough so there won't be a problem.
Green Lemon (2 years ago)
You forgot this : if a 16x16 surface of a chunk get updates (like a flat zone with redstone wire) it will update the entire chunk!!!!!
Me Its Lars (2 years ago)
True, 16*16 blocks will update then. Same with pistons
Bonny (2 years ago)
+CrushedPixel really helpful Video, thanks! I'll use this for my AdvMap :) Ps: I thought you are german? It's 2:00 Am here and you're uploading and commenting Videos!! :D Pps: thanks! Really it did helped me a lot! :)
Me Its Lars (2 years ago)
Same area
Waterstofperoxide (2 years ago)
But they are from Germany and you'r dutch. You can be friends with other languages but, its not the same, dutch and german :P
Me Its Lars (2 years ago)
+CrushedPixel i'm Dutch, shall we be friends? :P
Bonny (2 years ago)
+CrushedPixel Hehe ^^
CrushedPixel (2 years ago)
+Bonny I'm a programmer, I don't need sleep ;)
Jendrik Weise (2 years ago)
u said 265 not 256! :P thats the problem when u speak too much german! :P
Redstone Logic (2 years ago)
You said 265... Wordo
staffehn (2 years ago)
Knew those already, but the video is very helpful for others to spread the knowledge. I can quite clearly remember how bad of a time I had once when only using the have-everything-far-away-from-the-player strategy. Whenever I started my fill clocks while I was building or more often while debugging them, so I was near them, I would immediately lag out completely client-side with the effect of receiving only about 1-2 ticks per second and thus kind of falling behind the server in time, the server being a client in open-to-LAN mode of a friend who was just standing next to me in-game perfectly fine without any problems of lag whatsoever.
CrushedPixel (2 years ago)
+staffehn Yes, this video was also meant to explain to the mapmakers which know about the 63-block-limit *why* that's a thing.
Nope. (2 years ago)
I came
CrushedPixel (2 years ago)
+GersinMC and other funny-shitty minecraft videos Gersin, oh Gersin...
Filipp Lindholm (2 years ago)
I have alot of counting then i have maby 1000 command blocks in single chunk Nvm that is an easy fix when i will find out where is my spawn chunks
theantgre (2 years ago)
Dang it... I have some lag problems on my map, I don't have any chunk with 63 command block, but the playfield is very near to command blocks, and I can't move the playfield and neither the command blocks Because there are *A lot* of /tp commands and /setblock commands and they don't use relative coordinates... I'm stuck... I have to reduce clocks then...
Hii FourEightEight (2 years ago)
+theantgre but if they're absolute then moving them doesn't change anything, unless you mean the redstone is triggered by absolute commands, in which case nevermind.
theantgre (2 years ago)
+Hii FourEightEight I'll repeat it again... there are a lot of /setblock commands, if I move all command blocks then all the /setblock commands will be broken since they don't have relative coordinates I will try to change all of them, but it will take a lot of time
Hii FourEightEight (2 years ago)
+theantgre If you used MCEdit you could move them all in one go
theantgre (2 years ago)
+BoomBoomPowe I know but, there are lots of them, I can try but that would take hours to change everything
Jow (2 years ago)
+theantgre if they don't use relative coordinates, then you can move the command blocks, and do /setworldspawn to change where the spawn chunks are.
Nasm Nasmus (2 years ago)
I have two questions, you say that people should both have max. 63 command block and keep it far away from players. Isn't doing one of those enough? Also, do you have any proof that this causes significant lag? I agree that having people far from command blocks should always be done, but you make it sound like it causes over 50% of the lag.
Nasm Nasmus (2 years ago)
+CrushedPixel I have also seen the game code, but you can't determine how much something will lag from the game code. You can find something that is a potential issue, but that's about it. I agree that the redstone and command blocks in Missile Wars shouldn't have been near the players, but you keep refusing to give any proof or even indication on how much lag this causes. You haven't even answered my question on whether you think you need to both keep the command blocks away and fewer than 64. You say that this specific issue made the map unplayable on less powerful servers, do you have any evidence whatsoever for that?
CrushedPixel (2 years ago)
+Nasm Nasmus I've seen the game code. The amounts of data sent by servers using Chunk Data Packets are huge (up to several MB per second). Regarding Missile Wars, it was completely irresponsible by Seth and Cubehamster to have Redstone and Command Blocks near the spawn. That issue made the map unplayable on less powerful servers.
Nasm Nasmus (2 years ago)
+CrushedPixel I disagree that that video is proof enough. It proves that it is very real, but it doesn't show anything about how laggy it is on a server with real commands. For example, how much lag do you think it contributes to MissileWars map? Just a rough estimate, is it between 0-10%,10-30% or 40-70%? Again, I agree completely that command blocks should always be far from the player, but I do not think that you need to think about the amount of command blocks in a chunk(if they are far away from players already) and I do not think they cause as much lag as it seems like you are implying. I have done many hours of testing on what causes lag, and I'm not saying this is a non-issue. What makes you think this causes significant lag besides that video from samasaurus?
CrushedPixel (2 years ago)
+Nasm Nasmus Watch the video I linked in the description, that's proof enough.
Gui Chaguri (2 years ago)
This is a great explanation about packets for non-developers. If someone wants more information about packets http://wiki.vg/Protocol have all the information you need.
slicedlime (2 years ago)
Good video - although I would note that it's not enough to stay under 63 command blocks, you have to stay under 63 *updated blocks* per chunk - which includes any redstone blocks or other blocks being set by your fills.
slicedlime (2 years ago)
You might. In 1.9, you can mostly put them all in one chunk and get away with it if you set it up correctly.
Sonicninja (2 years ago)
so sliced, if I'm making a map, and i put all of my command blocks in one chunk, i have a problem... Im building a map, trailers on my channel.
slicedlime (2 years ago)
+Sonicninja No, not really. They've added new command block functionality that lets you, if you're careful, avoid this problem... so in a way they've "fixed" it - but if you build 64 blocks that update in a tick in 1.9, you'll still have exactly the same problem.
Sonicninja (2 years ago)
+slicedlime This has been fixed right? with 1.9?
slicedlime (2 years ago)
Rose Warrior (2 years ago)
So why do I lag when have anything over 42 command blocks in a chunk?
Rose Warrior (2 years ago)
You mean that little thing that you can get rid of that only people watching on the PC can see?
CrushedPixel (2 years ago)
+Rose Warrior Because the redstone blocks of the fill clock also count towards the 63 block limit. I added an annotation regarding this in the video.
Dasiturn (2 years ago)
If the blocks are being powered and unpowered in the same tick, won't they be the same at the end of each tick? Why would the server need to send all of this data if the blocks are essentially remaining the same to the client?
entereloaded (2 years ago)
+Uioman Cannot damn ur right. I didn't think about that =`}
entereloaded (2 years ago)
+AdityaTD the PE, XBox (and PlayStation?) versions are in C++ as far as I'm concerned and with Windows 10 they will release a new Minecraft game in C++ ported from PE or XBox (?)which also will be playable together with one of those. It was said that normal java Minecraft will be continued *at least* as long until the C++ Version won't have 'any' downsides anymore even concerning modding which is questionable because u will never be able to mod a C-Program as much as a Java Programm.
AdityaTD (2 years ago)
+entereloaded What do you even mean? Minecraft is a Java game. How did C++ came here?? U r weird!
Uioman Cannot (2 years ago)
+entereloaded You would kill every developer then.
entereloaded (2 years ago)
+AdityaTD well why not just slap the c++ developers whenever they do something wrong
seb sebien (2 years ago)
Thank y ou i finally canton open my server
Kaan (2 years ago)
how old r u when u r kid
Wassaka MC (2 years ago)
Please i need the minecraft replay mod plz!!!
Bonny (2 years ago)
Me too!! Go +CrushedPixel :P ;)
redstonenexus (2 years ago)
Thanks for the info :) I still don't know why it's lagging in singleplayer.
redstonenexus (2 years ago)
Ah, that makes sense.
CrushedPixel (2 years ago)
+redstonenexus When playing in Singleplayer, you're running an internal Server that communicates with the world. Large packets take a long time to send and process.
vlams redstonelab (2 years ago)
thanks for the useful information! i will use this a lot!
Agent Clyde (2 years ago)
Don't forget this also includes the red stone blocks that are being set and destroyed, making the actual max in each chunk about 48. I'd recommend you use a clock that switches between powering one set of 48 command blocks and a different set of 48 each tick, to get the most out of each chunk.
Me Its Lars (2 years ago)
Actually, if you place the clocks far away, there shouldn,t be a problem. Only if you need a /testfor command, it's gonna be hard. I recommend using testfor with coördinates, and not with radius.
CrushedPixel (2 years ago)
+Agent KillerBunny Valid point! That's something I missed in the video :)
Jaming Gaming (2 years ago)
Thought this just said: how to remove lag xD
Nabeken (2 years ago)
If this applies to all block changes, do my Command Blocks create less lag, if I clone a large structure in ~63 Block parts?
CrushedPixel (2 years ago)
+Nabeken Yes, I do believe so.
Nabeken (2 years ago)
Thanks for the response :D. How about Server Plugins? They are quiety Vanilla. Could a plugin like WorldEdit get less lagy by this technice?
CrushedPixel (2 years ago)
+Nabeken For your first question: Yes, cloning in pieces of less than 64 blocks should reduce lag. Note that you have to wait at least one tick before cloning the next piece! Regarding Mods, that depends how the Mods implement spawning large structures, but usually sending chunk data packets only a few times is not very laggy.
Nabeken (2 years ago)
+Nabeken Also something not Vanilla Minecraft related. Would this technice theoraticaly also work with Mods, which spawn larger structures?
IJAMinecraft (2 years ago)
Wow, that was very interesting and informative! Thanks for that! =)
AdityaTD (2 years ago)
+IJAMinecraft lol you are talking like you never knew it! xD
Bonny (2 years ago)
+IJAMinecraft well then :P ;)
IJAMinecraft (2 years ago)
+Bonny And that's actually how I pronounce it as well :p
Bonny (2 years ago)
Or hey "ItschaMinecraft" like +ConCrafter preferes saying his name :P
Jaming Gaming (2 years ago)
Hi IJAMinecraft :3
You said 56 instead of 65 xD
RimaNari (2 years ago)
+entereloaded Definitely very sadly. It's so unintuitive I start having troubles calling the numbers correctly in German when I speak or write English for a longer period of time. Can we change German in this regard please? :P
Bonny (2 years ago)
entereloaded (2 years ago)
+Velomo yea sadly.
Waterstofperoxide (2 years ago)
We say the last number first. (In more europe countries)
UNSPEAKABLE (2 years ago)
+Bonny ok :)
The Redstone Scientist (2 years ago)
You want to make sure not to place more than 63 CLOCKING BLOCKS Not just command blocks. Very informative and well made though!
The Redstone Scientist (2 years ago)
Good point
CrushedPixel (2 years ago)
+The Redstone Scientist As I said, "to be completely sure", never place more than 63 blocks. What if there are e.g. 60 cmd blocks on a fill clock and a player manually triggers 5 other command blocks in that chunk using a button? -> chunk data packet
ItzGameŻ (2 years ago)
10th comment
HilariousBibing (2 years ago)
Pretty nifty
mike conz (2 years ago)
How can I tell that a chunk is a spawn chunk vrs a non spawn chunk. Also how do I tell when the spawn chunk ends and a new one begins. Who would have ever thought that the word chunk would be so much fun to say!
CrushedPixel (2 years ago)
+mike conz This video by +xisumavoid is a good introduction on spawn chunks: https://www.youtube.com/watch?v=wQrmAps0Udo
CookiesAndMil_ (2 years ago)
I run a survival server with loads of redstone things changing it, it was lagging until I changed the clocks from 20 ticks to just a repeater clock of every 4 ticks.
Sam van der Kris (2 years ago)
+CookiesAndMil_ oohhhh....
CookiesAndMil_ (2 years ago)
+Sam Kris nope. Before this video I had changed everything to repeater clocks.
Sam van der Kris (2 years ago)
I think you mean from 4 ticks to 20, right?
ReduxRedstone (2 years ago)
very helpful
NateT_Bird (2 years ago)
Great video! I already do both of those things, but it is nice to know the reasons behind it. Keep up the great work! Have a great day!
piotrex43 (2 years ago)
I was curious about that mechanic when samasaurus posted a post on reddit about it... This info is useful info, thanks!
SQORED (2 years ago)
Very informative :)

Would you like to comment?

Join YouTube for a free account, or sign in if you are already a member.