Minecraft – What game mechanics in Minecraft cause lag

minecraft-java-edition

There are lots of articles on how to decrease lag by tweaking graphics settings, setting up graphics cards appropriately etc. That solves the problem for most, and while that helps, that doesn't get at all my problems.

I have a very large farming area, with mobs (hostile and passive), tons of redstone circuits, water channels, literally 1000's of hoppers, chests, 100's of minecarts, etc.

So, what (if any) of these cause more lag than others?

Clearly MOBS are a resource hog. If I have 100's spiders in my spider trap, or 1000's of chickens in my chicken farm the game is essentially unplayable. So, I've tweaked all the farms to reduce mob populations dramatically, and the iron golem farms have absolute minimal (16) numbers of villagers. This has helped enormously, but as I continue to grow the farming operations into new products, I'm starting to see more lag appear.

Any anecdotes or data on how much CPU various other in game mechanics consume? Things like:

  • Hoppers Dispensers
  • Redstone Circuits
  • Lava (still, or flowing)
  • Water (still or flowing)
  • Running Minecart?
  • Stationary minecart?
  • Item Frames and Paintings? (Both are entities, so do they consume more CPU resources?)

other things I've missed?

Thanks

Best Answer

Other than the typical solutions such as installing optifine, you can also dive deeper into the game mechanics and modify those to improve performance.

Vanilla achieves 'random' growth by selecting several thousand blocks each server tick, checking if they can grow or decay, and if they can, applying the growth or decay. This is the 2nd biggest drain on CPU, behind entities.

Seeing as its a farm... there's going to be a lot of calculations going on.

You can of course reduce this number of blocks per tick by installing Spigot and changing the config there, at the cost of slower growth of your crops on your farm.

There are various options you change to be checked at slower intervals, just a few are:

  • Snow form
  • Ice melt
  • Reducing number of mobs that spawn (those in caves under your farm still use up resources)
  • Leaf decay

Of course, upgrading your hardware is probably the most effective solution. It is most likely that the CPU will be your bottleneck, but RAM may also be the issue. Use F3 to check the RAM usage in-game.