<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Minecraft on</title><link>https://sean.redcoke.dev/tags/minecraft/</link><description>Recent content in Minecraft on</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><lastBuildDate>Wed, 23 Oct 2024 08:00:02 +0800</lastBuildDate><atom:link href="https://sean.redcoke.dev/tags/minecraft/index.xml" rel="self" type="application/rss+xml"/><item><title>Optimizing Minecraft</title><link>https://sean.redcoke.dev/posts/optimizing-minecraft/</link><pubDate>Wed, 23 Oct 2024 08:00:02 +0800</pubDate><guid>https://sean.redcoke.dev/posts/optimizing-minecraft/</guid><description>&lt;div style="border-left: 4px solid blueviolet; padding: 10px; margin: 10px 0px;" class="highlight"&gt;
&lt;div style="display: flex; align-items: center; margin-bottom: 5px;"&gt;
&lt;svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" style="width: 1.5rem; height: 1.5rem; margin-right: 10px; color: blueviolet;" aria-label="Info"&gt;
&lt;title&gt;Info&lt;/title&gt;
&lt;desc&gt;An info icon to represent an info message&lt;/desc&gt;
&lt;path stroke-linecap="round" stroke-linejoin="round" d="m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z" /&gt;
&lt;/svg&gt;
&lt;p dir="auto" style="font-weight: bold; margin: 0; color: blueviolet;"&gt;
Warning
&lt;/p&gt;
&lt;/div&gt;
&lt;p dir="auto" style="margin: 0; padding-left: 5px;"&gt;
This article is very opinion-based and may not be suitable for everyone. The following article is entirely based on my personal experience.
&lt;/p&gt;</description><content>
&lt;div style="border-left: 4px solid blueviolet; padding: 10px; margin: 10px 0px;" class="highlight"&gt;
&lt;div style="display: flex; align-items: center; margin-bottom: 5px;"&gt;
&lt;svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" style="width: 1.5rem; height: 1.5rem; margin-right: 10px; color: blueviolet;" aria-label="Info"&gt;
&lt;title&gt;Info&lt;/title&gt;
&lt;desc&gt;An info icon to represent an info message&lt;/desc&gt;
&lt;path stroke-linecap="round" stroke-linejoin="round" d="m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z" /&gt;
&lt;/svg&gt;
&lt;p dir="auto" style="font-weight: bold; margin: 0; color: blueviolet;"&gt;
Warning
&lt;/p&gt;
&lt;/div&gt;
&lt;p dir="auto" style="margin: 0; padding-left: 5px;"&gt;
This article is very opinion-based and may not be suitable for everyone. The following article is entirely based on my personal experience.
&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;In this article, I will not discuss about how you should configure your server settings, &lt;a href="https://github.com/YouHaveTrouble/minecraft-optimization"&gt;there are already a lot of guides out there&lt;/a&gt;.&lt;/p&gt;
&lt;h1 id="server"&gt;Server&lt;/h1&gt;
&lt;p&gt;Generally, you should avoid&amp;hellip;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Paid server jars that claimed to async-ify something
&lt;ul&gt;
&lt;li&gt;They are mostly scams / they are already implemented in open-source projects like Paper.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/watch?v=BQnejuEjMJs&amp;amp;t=1128s"&gt;asynchronous thing in minecraft is very hard&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Existing Implmentation that do async are still very WIP&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Anti-lag plugin that remove ground items/entities
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;paper.yml&lt;/code&gt; already has a setting for that.&lt;/li&gt;
&lt;li&gt;Most of them caused more lags than they fixed&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Using VPS that oversold their CPU
&lt;ul&gt;
&lt;li&gt;Check their reviews before buying.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="1-avoid-using-anti-lag-plugins"&gt;1. Avoid using &amp;ldquo;Anti-Lag&amp;rdquo; plugins&lt;/h2&gt;
&lt;p&gt;These plugins are designed to reduce server lag, but in most cases, they actually cause more issues than they solve. Additionally, most features they offer are probably already included in Paper (or its forks).&lt;/p&gt;
&lt;h2 id="2-hardware-problems"&gt;2. Hardware Problems&lt;/h2&gt;
&lt;p&gt;When consider upgrading your server hardware, you should focus on &lt;code&gt;SSD &amp;gt; RAM &amp;gt; CPU&lt;/code&gt;.&lt;/p&gt;
&lt;h3 id="io-speed-matter-a-lot"&gt;IO speed matter, a lot&lt;/h3&gt;
&lt;p&gt;Getting as fast as possible SSD is crucial, as server needs to load chunks to memory. If you are using a HDD, loading chunks can take a long time, which can cause lag spikes (especially in SMP servers, where multiple players are loading chunks at the same time).&lt;/p&gt;
&lt;p&gt;Get a NVMe SSD, ideally with a high IO speed and a DRAM caches.&lt;/p&gt;
&lt;h3 id="ram"&gt;RAM&lt;/h3&gt;
&lt;p&gt;Modern Minecraft servers require a lot of RAM. I would recommend at least &lt;a href="https://minecraft.wiki/w/Server/Requirements/Dedicated"&gt;4-6 GB of RAM&lt;/a&gt; even for a small-scale server. Although Minecraft can run with less RAM, but a lack of memory can cause the Garbage Collector (GC) to run more frequently.&lt;/p&gt;
&lt;p&gt;Beside that, consider use high frequency RAM (3200MHz or above). RAM speed would affect CPU performance in general.&lt;/p&gt;
&lt;h3 id="cpu"&gt;CPU&lt;/h3&gt;
&lt;p&gt;Minecraft servers are, unfortunately, mostly single-threaded (there are &lt;a href="https://github.com/PaperMC/Folia"&gt;some server jars that are multi-threaded&lt;/a&gt;, but as of writing, they are still unstable/early stage) with some task that are multi-threaded (like Asynchronous chunk loading, Networking etc). However the main game loop is still single-threaded. Therefore, having high single-core performance is crucial for good server performance. You don&amp;rsquo;t need a high core count, focus on single-core performance.&lt;/p&gt;
&lt;p&gt;Also, using VPS may not be a good choice, many of them are either oversold or have a &amp;ldquo;fair use&amp;rdquo; policy, which limits your CPU. Please consider finding a provider that offers dedicated servers.&lt;/p&gt;
&lt;h2 id="3-server-jar-jvm-and-fine-tuning-gc-with-jvm-arguments"&gt;3. Server Jar, JVM, and fine-tuning GC with JVM arguments&lt;/h2&gt;
&lt;p&gt;Using the right server jar may be the most important part of optimizing your server.&lt;/p&gt;
&lt;h3 id="server-jar"&gt;Server Jar&lt;/h3&gt;
&lt;p&gt;There are a lot of server jars out there, Here are some of the most popular ones:&lt;/p&gt;
&lt;h4 id="craftbukkit--spigot"&gt;CraftBukkit / Spigot&lt;/h4&gt;
&lt;p&gt;The foundation of almost all plugin servers. They offer a plugin API without changing vanilla mechanics. However, it is not recommended to use them as they are slow and outdated.&lt;/p&gt;
&lt;h4 id="paper"&gt;&lt;a href="https://papermc.io/"&gt;Paper&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;A fork of Spigot, with more optimizations and bug fixes. It is recommended to use this server jar. However, there is a problem&amp;hellip;&lt;/p&gt;
&lt;p&gt;Because of how PaperSpigot (AKA: paper) works, their patches also fix TNT duplication and other “bugs” (some may consider them features), which can cause redstone contraptions to fail. Therefore, using Fabric (with optimization mods) is also a great choice for optimizing your server.&lt;/p&gt;
&lt;h4 id="purpur"&gt;&lt;a href="https://purpurmc.org/"&gt;Purpur&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;A fork of an archived project called &lt;a href="https://github.com/Tuinity/Tuinity"&gt;Tuinity&lt;/a&gt; (which is a fork of Paper). It is a great choice for optimizing your server with a lot of customization. It is a drop-in replacement for Paper, so you can just replace the jar and start the server.&lt;/p&gt;
&lt;h4 id="leaf"&gt;&lt;a href="https://github.com/Winds-Studio/Leaf"&gt;Leaf&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;A new server jar created in June 2022, originally designed for &amp;ldquo;&lt;a href="https://winds-studio.github.io/breeze.asia/"&gt;Winds Network&lt;/a&gt;&amp;rdquo;, but now aimed to be a drop-in replacement balancing performance, vanilla gameplay, and compatibility. There are still some incompatibilities with some plugins, so be aware of that.&lt;/p&gt;
&lt;h4 id="folia"&gt;&lt;a href="https://papermc.io/software/folia"&gt;Folia&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;A server jar that is multi-threaded. It is still in the early stages, and a lot of plugins are not compatible with it, so it is not recommended for production use.&lt;/p&gt;
&lt;h4 id="other-forks"&gt;Other Forks&lt;/h4&gt;
&lt;p&gt;There are a lot of optimizing forks out there, However I wouldn&amp;rsquo;t recommend using them, as they are mostly outdated (or even abandoned), with &lt;a href="https://github.com/YatopiaMC/Yatopia/issues/226"&gt;some forks even had user claimed getting chunk corruption&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Therefore, I suggest only using well-known server jar forks or well-maintained forks, as you are more likely to get help when you have a problem.&lt;/p&gt;
&lt;p&gt;As for paid server jars, unless you are willing to take the risk of exit scams, lack of support, bugs, etc., I suggest you stay away from paying for a server jar. Most of the time, they are just forks of open-source projects with small modifications. (I&amp;rsquo;m not saying all paid server jars are bad; some are actually well-maintained, but most are not, so be careful.)&lt;/p&gt;
&lt;h3 id="jvm"&gt;JVM&lt;/h3&gt;
&lt;p&gt;Using different JVMs can also affect your server performance. Here are some of the most popular JVMs server owners use:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Reminder: Some JVMs have been reported to have incompatibilities with other plugins. Please do your research before using them in production.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.graalvm.org/"&gt;GraalVM&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/corretto/"&gt;Amazon Corretto&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.eclipse.org/openj9/"&gt;OpenJ9&lt;/a&gt; - (Warning: Some plugins may not work with this JVM)&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id="jvm-arguments"&gt;JVM Arguments&lt;/h4&gt;
&lt;p&gt;In addition to using different JVMs, specifying JVM arguments can also greatly improve your server performance! I highly recommend users who use Paper (and its forks) to use &lt;a href="https://docs.papermc.io/paper/aikars-flags"&gt;Aikar&amp;rsquo;s flags&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;If you are running &lt;a href="https://github.com/pufferfish-gg/Pufferfish"&gt;Pufferfish&amp;rsquo;s fork&lt;/a&gt; (&lt;a href="https://sean.redcoke.dev/posts/optimizing-minecraft/#purpur"&gt;Purpur&lt;/a&gt;, &lt;a href="https://sean.redcoke.dev/posts/optimizing-minecraft/#leaf"&gt;Leaf&lt;/a&gt;, &lt;a href="https://github.com/LeavesMC/Leaves"&gt;Leaves&lt;/a&gt;, etc.), you can use &lt;a href="https://docs.pufferfish.host/optimization/how-to-apply-aikars-flags/"&gt;Pufferfish&amp;rsquo;s flags&lt;/a&gt; to add SIMD vector optimization for better performance.&lt;/p&gt;
&lt;p&gt;To enable it, simply add &lt;code&gt;--add-modules=jdk.incubator.vector&lt;/code&gt; to your JVM arguments to enable it.&lt;/p&gt;
&lt;h1 id="client"&gt;Client&lt;/h1&gt;
&lt;h2 id="1-stop-using-optifine"&gt;1. Stop using Optifine&lt;/h2&gt;
&lt;p&gt;Optifine is not open source, and it messes with the vanilla code (outside of the rendering code), which can cause incompatibilities with other mods.&lt;/p&gt;
&lt;p&gt;However, Optifine is still a decent choice for people who mainly do PvP (as the majority of the player base is still on 1.8.9), but this guide is for people who play on newer versions.&lt;/p&gt;
&lt;p&gt;For 1.16.5 and above, Sodium is a better choice for performance.&lt;/p&gt;
&lt;h2 id="2-fabric-with-mods"&gt;2. Fabric with Mods&lt;/h2&gt;
&lt;p&gt;Using mods can also help with your client performance. Here are some of the most popular mods:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://modrinth.com/mod/sodium"&gt;Sodium&lt;/a&gt; - Basically a must-have mod for improving your client performance. In my personal experience running Sodium on a laptop (i7-1355U, 16GB RAM, Intel Arc A350M) boosted my FPS from 47 to 120 (dedicated server, 1.20.1, same settings).&lt;/li&gt;
&lt;li&gt;&lt;a href="https://modrinth.com/mod/lithium"&gt;Lithium&lt;/a&gt; - Improves Minecraft code without changing the vanilla mechanics.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://modrinth.com/mod/ferrite-core"&gt;FerriteCore&lt;/a&gt; - A mod that &lt;a href="https://github.com/malte0811/FerriteCore/blob/main/summary.md"&gt;optimizes memory usage&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://modrinth.com/mod/krypton"&gt;Krypton&lt;/a&gt; - A mod that optimizes network performance, from the developer of &lt;a href="https://velocitypowered.com/"&gt;Velocity&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://modrinth.com/mod/entityculling"&gt;Entity Culling&lt;/a&gt; - Culls entities that are not visible to the player using async path-tracing.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://modrinth.com/mod/iris"&gt;Iris Shaders&lt;/a&gt; - A shader mod that aims to be compatible with Optifine shaders.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Just to name a few. Many of them can also be installed on the server side, so you can have better TPS &lt;strong&gt;and&lt;/strong&gt; FPS at the same time.&lt;/p&gt;
&lt;p&gt;If you are lazy to find them and just want a one-click solution, check out &lt;a href="https://modrinth.com/modpack/fabulously-optimized"&gt;Fabulously Optimized&lt;/a&gt;, a modpack aimed at optimizing your client/server performance.&lt;/p&gt;
&lt;h1 id="conclusion"&gt;Conclusion&lt;/h1&gt;
&lt;blockquote&gt;
&lt;p&gt;Disclaimer: None of the server jars, mods, and JVMs mentioned in this article are sponsored. None of the links are affiliate links.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Overall, optimizing a Minecraft server is not easy, and not everyone&amp;rsquo;s configuration works for you. Take this article as a reference, not a copy-paste guide. There are a lot of factors that can affect your server performance, and not all of them are mentioned in this article.&lt;/p&gt;</content></item></channel></rss>