ENHANCED MINECRAFT JAVA SERVER OPTIMIZATION GUIDE

This comprehensive guide focuses on optimizing Minecraft Java servers. Please read the entire guide for a thorough understanding of server optimization techniques.

CHOOSING THE RIGHT JAR FILE

Before diving into optimization, let's look at choosing the right server JAR:

  1. PaperMC - Offers significant performance improvements over vanilla.
  2. Purpur - A fork of PaperMC, provides even better performance than Paper.
  3. Folia - Designed for multi-threaded performance on larger servers. Note: Not compatible with all plugins.
  4. Aikars Flags - While not a JAR, these are optimized JVM flags that can significantly improve server performance.

Each of these JARs provides excellent performance improvements over vanilla Minecraft. PaperMC is the standard for performance and compatibility, but the other JARs offer additional benefits.

WHAT TO AVOID

PERFORMANCE-ENHANCING PLUGINS

Consider these plugins to help with server performance:

  1. ClearLag - Removes entities, limits mob spawning, and cleans up the server.
  2. Chunky - Pre-generates Minecraft chunks to reduce lag during exploration.
  3. Spark - Advanced profiler for analyzing and optimizing Minecraft server performance.
  4. EntityTrackerFixer - Reduces lag caused by entity tracking.
  5. FastAsyncWorldEdit (FAWE) - Optimized version of WorldEdit for faster world manipulation.
  6. TickProfiler - Diagnoses lag sources and provides detailed server performance analysis.
  7. Lag Assist - Comprehensive lag reduction and server optimization plugin.
  8. Farm Limiter - Limits farm sizes to prevent excessive lag from large automated farms.
  9. VillagerOptimiser - Optimizes villager behavior to reduce server load.

SERVER CONFIGURATIONS

server.properties

view-distance=8
simulation-distance=6
network-compression-threshold=256
max-players=20
max-tick-time=60000
use-native-transport=true
enable-command-block=false
sync-chunk-writes=true
spawn-protection=16
entity-broadcast-range-percentage=100

spigot.yml

settings:
  save-user-cache-on-stop-only: true
  max-tick-time:
    tile: 1000
    entity: 1000

world-settings:
  default:
    mob-spawn-range: 6
    entity-activation-range:
      animals: 32
      monsters: 32
      raiders: 48
      misc: 16
    tick-inactive-villagers: false
    merge-radius:
      item: 2.5
      exp: 3.0
    item-despawn-rate: 6000
    arrow-despawn-rate: 1200
    nerf-spawner-mobs: true
    max-entity-collisions: 8
    hopper-amount: 1
    dragon-death-sound-radius: 0
    seed-village: 10387312
    seed-desert: 14357617
    seed-igloo: 14357618
    seed-jungle: 14357619
    seed-swamp: 14357620
    seed-monument: 10387313
    seed-shipwreck: 165745295
    seed-ocean: 14357621
    seed-outpost: 165745296
    seed-endcity: 10387313
    seed-slime: 987234911
    seed-nether: 30084232
    seed-mansion: 10387319
    seed-fossil: 14357921
    seed-portal: 34222645

bukkit.yml

spawn-limits:
  monsters: 50
  animals: 10
  water-animals: 5
  water-ambient: 20
  ambient: 5

chunk-gc:
  period-in-ticks: 600

ticks-per:
  animal-spawns: 400
  monster-spawns: 1
  autosave: 6000

aliases: now-in-commands.yml

paper.yml

max-auto-save-chunks-per-tick: 24
optimize-explosions: true
mob-spawner-tick-rate: 2
container-update-tick-rate: 3
grass-spread-tick-rate: 4
despawn-ranges:
  monster:
    soft: 32
    hard: 128
hopper:
  disable-move-event: true
anti-xray:
  enabled: true
  engine-mode: 1
use-faster-eigencraft-redstone: true
armor-stands-tick: false
per-player-mob-spawns: true
alt-item-despawn-rate:
  enabled: true
  items:
    COBBLESTONE: 300
    NETHERRACK: 300
    DIRT: 300
    SAND: 300
max-entity-collisions: 2
tick-rates:
  sensor:
    villager: 1
    raid: 1
    hoglin: 1
collisions:
  allow-vehicle-collisions: false
  fix-climbing-bypassing-cramming-rule: true
  only-players-collide: true
entity-per-chunk-save-limit:
  experience_orb: 16
  snowball: 16
  ender_pearl: 16
  arrow: 16
prevent-moving-into-unloaded-chunks: true
use-faster-threadlocalrandom: true
lava-flow-speed:
  normal: 30
  nether: 10

purpur.yml (if using Purpur)

settings:
  use-alternative-item-despawn-rate: true
  use-faster-night-skip: true
  use-faster-eigencraft-redstone: true
  dont-send-useless-entity-packets: true
  dont-send-useless-lightning-packets: true
  keep-spawn-loaded: false
  keep-spawn-loaded-range: 8

world-settings:
  default:
    mobs:
      cow:
        ridable: true
        controllable: true
      chicken:
        ridable: true
        controllable: true
    gameplay-mechanics:
      disable-ice-and-snow: true
      disable-teleportation-suffocation-check: true
      disable-chest-cat-detection: true
      disable-end-credits: true
      disable-phantom-spawns: true
      disable-pillager-patrols: true

ADDITIONAL OPTIMIZATION TIPS

  1. Pre-generate your world: Use a plugin like Chunky to pre-generate your world. This reduces lag caused by chunk generation during gameplay.
  2. Optimize your network settings:
  3. Use SSDs for storage: SSDs can significantly improve chunk loading and saving times.
  4. Monitor and adjust: Regularly use tools like Spark or Timings to monitor your server's performance and adjust settings accordingly.
  5. Keep software updated: Regularly update your server software, Java version, and plugins to benefit from the latest optimizations and bug fixes.
  6. Limit redstone complexity: Excessively complex redstone contraptions can cause significant lag. Consider using plugins that optimize redstone or limit its complexity.
  7. Control entity cramming: Use the max-entity-cramming gamerule to limit the number of entities that can be pushed into one block.
  8. Optimize plugin usage: Only use necessary plugins and ensure they are compatible and optimized for your server version.
  9. Configure view distance dynamically: Consider using a plugin like ViaVersion to dynamically adjust player view distances based on server load.
  10. Limit chunk loading: Use a plugin like ChunkMaster to control and optimize chunk loading, especially for teleportation and world generation.

MONITORING AND TROUBLESHOOTING

Continuous monitoring and troubleshooting are crucial for maintaining an optimized Minecraft server. Here are some tools and techniques to help you keep your server running smoothly:

  1. Timings Reports: Use /timings report in-game or console to generate a detailed report of server performance. This helps identify plugins or areas of the game causing lag.
  2. Spark Profiler: If installed, use /spark profiler to get more detailed performance analysis, including CPU usage breakdowns.
  3. Console Logging: Regularly check your server console for warnings, errors, or unusual messages that might indicate performance issues.
  4. Performance Monitoring Plugins: Consider using plugins like LagMonitor or ServerStats to get real-time performance data.
  5. External Monitoring Tools: Use external monitoring services like UptimeRobot to keep track of your server's availability.
  6. Regular Performance Audits: Schedule regular audits of your server's performance, checking things like TPS (ticks per second), memory usage, and CPU load.

BEST PRACTICES FOR ONGOING MAINTENANCE

To keep your Minecraft server optimized over time, consider the following best practices:

  1. Regular Updates: Keep your server software, plugins, and Java runtime up to date to benefit from the latest optimizations and security patches.
  2. Plugin Management: Regularly review your plugins. Remove any that are no longer needed, and look for lighter alternatives to heavy plugins.
  3. World Management:
  4. Backup Strategy: Implement a robust backup strategy to protect against data loss and allow for quick recovery in case of issues.
  5. Player Education: Educate your players about lag-inducing behaviors (like creating overly complex redstone contraptions) and server-friendly practices.
  6. Scheduled Restarts: Implement scheduled server restarts (e.g., daily) to clear memory and reset any accumulated issues.
  7. Performance-Based Decisions: Make gameplay decisions with performance in mind. For example, limit the use of entities as decorations or the complexity of automatic farms.
  8. Scalability Planning: Plan for scalability. As your server grows
  9. Scalability Planning: Plan for scalability. As your server grows, be prepared to upgrade hardware or optimize further.
  10. Community Feedback: Encourage your community to report performance issues and consider their feedback in your optimization efforts.
  11. Stay Informed: Keep up with the latest Minecraft server optimization techniques by following relevant forums, blogs, and community discussions.

CONCLUSION

Optimizing a Minecraft server is an ongoing process that requires attention to detail, regular maintenance, and a willingness to adapt to changing conditions. By implementing the configurations and practices outlined in this guide, you'll be well on your way to running a smooth, efficient Minecraft server.

Remember that every server is unique, with its own set of plugins, player behaviors, and hardware limitations. Use this guide as a starting point, but don't be afraid to experiment and find the perfect balance for your specific server.

Credits