Complete Guide to Reducing Lag in BTH - Beyond the Horizon Modpack

Complete Guide to Reducing Lag in BTH - Beyond the Horizon Modpack

16 min read

BTH - Beyond the Horizon is an ambitious modpack that combines exploration, technology, and magic with stunning visual enhancements through Distant Horizons. However, with over 200 mods and advanced terrain generation, performance optimization is crucial for a smooth gameplay experience. This guide will help you eliminate lag and maximize performance in both single-player and multiplayer environments.

BTH scenic landscape with Distant Horizons

Why Does BTH Beyond the Horizon Lag?

The most common causes of lag in BTH include:

  • Chunk Generation: Creating new chunks as you explore is the #1 performance killer
  • Distant Horizons LOD Generation: Building Level of Detail data for distant terrain
  • Memory Management: Java garbage collection with insufficient allocated RAM
  • Render Distance Settings: Trying to render too much at once

Memory Considerations

By default Minecraft launchers don't allocate enough memory. You may receive a warning like this when you start the game. I have 9GB of RAM allocated to my game, which will work, but 10-12GB is recommended as a minimum. This is suggesting 16GB mostly because I have 36GB of RAM on my computer. If you have 16GB, you'll get a lower recommendation, probably closer to 10GB.

DH memory warning dialog

If you do get this warning, be sure to check your launcher's java memory settings.

The Solution: World Pregeneration

Pregenerating your world is the single most effective way to reduce lag. By generating chunks ahead of time, you eliminate the performance hit that occurs when exploring new areas.

Benefits of Pregeneration

  • Smooth chunk loading even when traveling at high speeds
  • No lag spikes when using elytra or other fast travel methods
  • Consistent server performance with multiple players exploring
  • Better memory management with pre-loaded LOD data

Storage Requirements

A fully pregenerated world with a radius of 512 chunks (8,192 blocks) will require approximately:

  • Overworld: ~20GB including region files and LOD data
  • Nether/End: ~10GB each
  • Other Dimensions: ~10GB each

Plan for at least 60GB of free space for a complete pregeneration of all dimensions.

Important: Distant Horizons vs Chunky

Do NOT use Chunky and Distant Horizons together! The pack previously included Chunky but it has been removed due to conflicts with DH.

Why We Removed Chunky

  • Memory conflicts when running both DH and Chunky simultaneously
  • DH's generation mode already saves chunks when set to "full"
  • Running both causes excessive RAM usage and potential crashes
  • DH alone is more efficient for the visual enhancements it provides

When Chunky Might Still Be Useful

  • Server-only environments without DH installed
  • If you completely disable DH and want traditional chunk pregeneration
  • Legacy worlds that were created before DH integration

Recommendation: Use DH exclusively with generation mode set to "full" for best results.

Single Player Pregeneration Walkthrough

Step 1: World Creation

  1. Launch BTH and click "Singleplayer"
  2. Create New World with your preferred settings
  3. World Type: Default - Terralith and other terrain mods will override any world type settings.
  4. Click "Create World" and wait for initial spawn
  5. Consider enabling "Allow Cheats"

Note: Pregenerating your world may involve being AFK for several hours and being able to switch to creative mode is a good option. If that doesn't sit well, no problem, but if you want creative or peaceful mode as an option, this is the time to set Allow Cheats to ON.

Step 2: Look at the F3 Screen

The right side of the F3 screen shows you your current memory usage as well as the Distant Horizon activity. If you cannot see the information, you may want to reduce your GUI scale. The World Gen/Import Tasks and lines below that will tell you what Distant Horizons is doing. As long as you see Active and in progress tasks, that means DH is working. If it's working hard like when you join a new world or explore into new unrendered areas, depending on your PC, this could cause significant lag.

F3 screen showing DH activity

Step 3: Access Distant Horizons Settings

  1. Press ESC to open the pause menu (game won't actually pause with chat open)
  2. Click "Options"
  3. Look for the DH button - It's a small square icon in the top-left, next to the FOV slider
  4. Click the DH button to open Distant Horizons settings

Options menu with DH button highlighted

Step 4: Configure for Pregeneration

In the DH settings menu, navigate to these options:

Rendering tab:

  1. Set "LOD Chunk Render Distance Radius" to 512. The default is 64 to be easy on more people's computers.
  2. Set "Enable Distant Generation" to True. True is the default so this should already be set.
  3. To speed things up, and if you intend to AFK, set CPU Load to 5. I paid for the whole CPU

DH Rendering settings

In the Advanced Settings > World Generator Tab you can enable Show Generation Progress to get a screen overlay or updates in chat indicating progress and time remaining. Note the time may be very inaccurate!

DH progress overlay showing inflated ETA

You can see mine started at 63 hours. Generally, this is inaccurate.

DH chunk generation progress

Also note that the number of chunks remaining is growing a bit. A 512 chunk radius is actually a 1024x1024 chunk square, which is 1,048,516 chunks. Mine is showing more than that because I've moved around a bit and expanded the generation.

Step 5: Generation and Monitor

  1. Click "Done" to exit settings
  2. Click "Back to Game"
  3. Watch the generation begin - You'll see messages in chat or F3 screen
  4. Press F3 to monitor:
    • RAM usage (should stay below your allocated amount)
    • Chunk generation progress
    • Current FPS (will be low during generation)

Step 6: Wait for Completion (4-8 hours)

What to expect:

  • Initial burst of activity as nearby chunks generate
  • Gradual slowdown as it reaches farther areas
  • ETA will be wildly wrong (ignore it)

You can:

  • Leave computer running overnight
  • Move around if needed (adds more chunks but that's fine)
  • Check progress periodically with F3

Step 7: Setup for AFK

  1. Quick Safety (Choose one):
    • Press F3+N to toggle to Creative mode, OR
    • Dig straight down 3 blocks and place a block above you, OR
    • Build a quick 3x3x3 dirt shelter
  2. Prevent Pausing: Press T to open chat (leave it open)
    • This prevents the memory leak issue when paused

Step 8: Configure for Gameplay

Once generation is complete (or sufficient for your needs):

  1. Press ESC then open DH Settings again
  2. Adjust for gameplay:
    • LOD Chunk Render Distance: 80-128 (based on preference). If you keep the chunk render distance at 512, DH will continue to work hard as you move around to generate the far away chunks.
    • CPU Load: Minimal Impact or Balanced
    • At any time you can set Enable Distant Generation: False to prevent lag spikes while exploring)
  3. Close chat and begin playing!

Common Setup Issues & Solutions

"Game crashes during generation"

  • Reduce CPU Load to "Balanced"
  • Allocate more RAM (12GB recommended)
  • Close other programs to free memory

"Generation seems stuck"

  • Normal for farther chunks to generate slowly
  • Check F3 - if numbers are changing, it's working
  • Can take 30+ minutes between visible progress updates

"Want to stop and resume later"

  • You can reduce or turn off the DH generation if you want to play and not be impacted.
  • Simply exit the world - DH saves progress
  • When you reload, it continues from where it left off
  • Keep same settings to resume efficiently

Monitoring Progress

  • Watch the F3 debug screen for chunk loading information
  • Check the DH rendering statistics in the settings menu
  • Monitor RAM usage to ensure you're not hitting memory limits
  • Expect 4-8 hours for full overworld pregeneration depending on your CPU

Understanding DH Chunk Numbers

Don't be confused by the chunk counter! When generating a 512 chunk radius:

  • Expected: ~1 million chunks (1024×1024 square = 1,048,576 chunks)
  • What you might see: 2+ million chunks to process

Why the numbers seem high:

  • DH generates chunks in a square, not a circle (512 radius = 1024×1024 area)
  • Moving around during generation expands the area (this is fine, just adds more chunks)
  • The ETA is wildly inaccurate - showing 70+ hours when actual time may be much less

Best practice for AFK generation:

  1. Dig a safe hole or build a small shelter
  2. Open chat with 'T' to prevent pausing (avoids memory leak)
  3. Go AFK and let it run - movement is fine but will add chunks
  4. A 512 chunk radius gives you a massive play area

Multiplayer/Server Pregeneration

Using DH Pregen Commands

Execute these commands in the server console or in-game as an admin:

Overworld (Full Size)

/dh pregen start minecraft:overworld 0 0 512

Other Dimensions (Half Size)

/dh pregen start minecraft:the_nether 0 0 256  
/dh pregen start minecraft:the_end 0 0 256  
/dh pregen start aether:the_aether 0 0 256  
/dh pregen start rats:ratlantis 0 0 256

Advanced Server Configuration

Thread Optimization

When no players are online, maximize pregeneration speed:

/dh config common.threadPreset I_PAID_FOR_THE_WHOLE_CPU

For active gameplay, reduce to:

/dh config common.threadPreset Minimal_Impact

Monitoring and Management

/dh pregen status - Check current pregeneration progress  
/dh pregen stop - Cancel pregeneration entirely

Note: Unlike some other pregeneration tools, Distant Horizons doesn't have built-in pause/resume commands. If you need to temporarily stop pregeneration, you'll need to use /dh pregen stop and then restart with a new /dh pregen start command.

Important Server Notes

  • World Trimming: If you trim your world, delete the DH LOD data file (world/data/DistantHorizons.sqlite for overworld) before starting new pregeneration
  • Backup First: Always backup your world before major pregeneration operations
  • Schedule Wisely: Run intensive pregeneration during off-peak hours

JVM Optimization

  • Minimum: 10GB RAM (-Xmx10G) - 8GB will trigger insufficient memory warnings
  • Recommended: 12GB RAM (-Xmx12G) - optimal for DH pregeneration
  • Maximum: 16GB RAM (-Xmx16G) - only if you have 32GB+ system RAM

Optimized JVM Arguments

For modern Java 17+ (required for BTH):

-Xmx12G -Xms12G
-XX:+UseG1GC -XX:+ParallelRefProcEnabled 
-XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions 
-XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1NewSizePercent=30 
-XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M 
-XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 
-XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 
-XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 
-XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1

Note: These are based on the widely-used Aikar's flags, optimized for modded Minecraft. The -Xmx and -Xms flags set the memory allocation (adjust based on your available RAM: 10G for 16GB system RAM, 12G for 24GB+, up to 16G max). Some launchers handle these memory flags separately in their settings. If your launcher doesn't allow you to set -Xmx and -Xms in the JVM arguments field, use this version without them:

-XX:+UseG1GC -XX:+ParallelRefProcEnabled 
-XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions 
-XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1NewSizePercent=30 
-XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M 
-XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 
-XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 
-XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 
-XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1

For systems with 12GB+ allocated: Consider changing -XX:G1HeapRegionSize=8M to 16M for better performance with large modpacks.

In-Game Performance Settings

Video Settings Optimization

Essential Settings

  • Render Distance: 12-16 chunks (DH handles distant terrain)
  • Simulation Distance: 8-10 chunks
  • Graphics: Fast or Fancy (minimal difference in BTH)
  • Smooth Lighting: On (minimal performance impact)
  • VSync: Off (unless experiencing screen tearing)
  • Max Framerate: Match your monitor refresh rate

Shader Settings

BTH includes Complimentary Shaders (both Reimagined and Unbound versions) which are well-optimized for the pack:

  • The included Complimentary shaders work well for most systems
  • Disable shadow rendering beyond 80 blocks for better performance
  • Reduce shadow resolution to 1024 or 2048 if needed
  • Turn off volumetric fog/clouds if experiencing lag
  • As a last resort: Disable shaders entirely if they're causing significant performance issues

Mod-Specific Optimizations

Distant Horizons Runtime Settings

  • Quality Preset: Medium for balanced performance
  • LOD Dropoff: Smooth for better visuals without performance hit
  • Brightness Multiplier: 1.0 (higher values impact performance)

Create Mod

  • Reduce contraption complexity near spawn
  • Limit the number of active contraptions
  • Use fewer animated blocks in builds

Applied Energistics 2

  • Keep ME systems chunk-loaded but compact
  • Avoid excessive use of import/export buses
  • Use acceleration cards judiciously

Troubleshooting Common Issues

Botania + Shaders: Invisible Gaia Guardian

A known issue causes the Gaia Guardian to be invisible when using shaders. The pack now disables Botania shaders by default, but if you're experiencing this:

Solution 1: Show Hitboxes

  • Press F3+B to display hitboxes and fight the invisible guardian
    Solution 2: Disable Botania Shaders Only
  1. Press Escape → Mods
  2. Search for "Botania"
  3. Click Config → Modify (next to Client)
  4. Click Rendering
  5. Set Shaders to "Off"
  6. Click Home → Save

This fix also makes mana pools visible with shaders enabled.

"Out of Memory" Errors

  • Increase allocated RAM to 12GB minimum
  • Reduce render distance temporarily
  • Clear Distant Horizons cache if corrupted
  • Ensure you're not running Chunky alongside DH

Chunk Loading Stutters

  • Ensure pregeneration is complete
  • Check if antivirus is scanning Minecraft files
  • Disable Windows Game Mode if enabled

Server TPS Drops

  • Use /forge tps to identify laggy dimensions
  • Check for excessive entity counts with /forge entity list
  • Consider using lag-clearing plugins/mods

Visual Glitches with Distant Horizons

  • Regenerate LOD data: Delete .minecraft/Distant_Horizons_server_data
  • Ensure shaders are DH-compatible
  • Update to latest DH version compatible with BTH

Advanced Lag Reduction: Smart Chunk Loading

Based on community testing, here are advanced strategies to reduce lag from farms and automation:

Remote Farm Management with Hyperboxes

Instead of keeping all farms loaded and causing lag, use Hyperboxes to activate farms on-demand:

  1. Build farms inside Hyperboxes in remote locations
  2. Use Modular Routers to place/break Hyperboxes as needed
  3. Benefits: Farms only load when actively producing
  4. Result: Massive FPS improvement at your base

AE2 Spatial Storage for Heavy Farms

For extremely laggy farms near your base:

  1. Store entire farms in AE2 Spatial Storage cells
  2. Load them only when production is needed
  3. Unload immediately after production completes
  4. Perfect for lag-intensive mob farms or complex automation

Smart Train-Based Chunk Loading

Create trains can activate remote farms intelligently:

  1. Set up minimal chunk loaders at train stations (1x1)
  2. Use detector rails to trigger larger chunk loaders on arrival
  3. Train schedules: Depart at 20% stock, return when full
  4. Farms auto-deactivate when train leaves

Selective Dimension Loading

  • Keep farms in separate dimensions (Hyperbox, etc.)
  • Only load dimensions when needed for production
  • Use Ars Nouveau portals with chunk-loading entities for activation

Maintenance and Best Practices

Regular Maintenance

  1. Weekly: Clear old backups to save disk space
  2. Monthly: Optimize world with MCA Selector (remove unused chunks)
  3. As Needed: Update mods when stable versions release

Building for Performance

  • Avoid massive farms near spawn
  • Spread out technical builds across chunks
  • Use chunk loaders sparingly and efficiently
  • Keep redstone contraptions simple

Entity Reduction Strategies

Entities (mobs, villagers, items) are one of the biggest causes of lag. BTH offers smart alternatives:

Smart Villager Management

  • Use Supplementaries Jars instead of villager trading halls
    • Store villagers in jars when not trading
    • Deploy only when needed for trades
    • Massively reduces entity count and pathfinding calculations

Efficient Mob Farming

Replace traditional mob farms with these lag-friendly alternatives:

  • Ars Nouveau Drygmies: Magical entities that generate drops without spawning mobs

    • Set up source farms with drygmies for mob drops
    • No actual mob spawning = no entity lag
    • Works for most hostile and passive mob drops
  • Hostile Neural Networks: Simulate mob farming digitally

    • Train data models on mob drops
    • Generate resources without spawning entities
    • Extremely efficient for late-game resource generation

General Entity Tips

  • Keep animal pens small (5-10 animals max per type)
  • Prevent item entity buildup with smart collection:
  • BTH includes automatic item cleanup that detects and removes excessive drops from farms
  • Avoid water-stream mob farms in favor of the alternatives above

Multiplayer Considerations

  • Communicate with players before pregeneration
  • Set world borders after pregeneration to prevent expansion
  • Monitor server resources during peak hours
  • Consider player limits based on server capacity

Quick Reference Checklist

New World Setup

  • Allocate 10-12GB RAM
  • Apply optimized JVM arguments
  • Create world backup
  • Start pregeneration process
  • Configure DH settings for pregeneration
  • Monitor progress for 4-8 hours
  • Adjust settings for gameplay
  • Test performance in various biomes

Performance Monitoring Tools

  • F3 Debug Screen: Real-time performance metrics
  • Spark Mod: Detailed profiling for advanced users
  • Task Manager/Activity Monitor: System resource usage
  • Server Console: TPS and player activity monitoring

Conclusion

With proper pregeneration and optimization, BTH - Beyond the Horizon can run smoothly even on mid-range hardware. The key is investing time upfront in world pregeneration and finding the right balance of settings for your system. Remember that every system is different, so experiment with these settings to find what works best for your setup.

For additional help, join the BTH community Discord or check the modpack's CurseForge page for updates and community-contributed performance tips. Happy exploring in your lag-free world!