DeerFolia · Configuration
Docs/deerfolia/DeerFolia · Configuration

DeerFolia · Configuration

Configure DeerFolia optimization groups and AFK network settings.

File structure

Use the following structure as a reference. The server adds comments to the generated file. If the generated file contains a different key, follow the generated file.

dynamic-activation-brain:
  enabled: true
  start-distance: 12
  activation-distance-mod: 8
  maximum-activation-prio: 20

async-pathfinding:
  enabled: true
  async-pathfinding-keep-alive: 60
  async-pathfinding-max-threads: 20

kaiiju-entity-throttling: true

network-optimizations:
  optimized-var-int: true
  optimized-frame-encoding: true

lithium-optimize:
  enabled: true
  allocations: true
  ai: true
  collections: true
  entity: true
  math: true
  world: true

poi-optimizations:
  enabled: true
  golem-spawn-check-interval: 200
  secondary-poi-sensor-interval: 80
  village-distance-cache-duration: 100
  golem-spawn-player-distance-limit: 128

afk-network-optimization:
  enabled: true
  afk-threshold-ticks: 1200
  afk-enter-message: "&7[AFKNet] &eYou are now AFK. &7DeerFolia will temporarily suppress non-essential packets to save bandwidth."
  afk-exit-message: "&7[AFKNet] &aWelcome back! &7During this AFK session, you saved &b{saved_traffic} &7of traffic and up to &b{saved_bandwidth} &7of bandwidth. &aThanks for helping the server save costs!"
  count-look-changes-as-activity: true
  resync-on-resume: true
  stats-enabled: true
  suppression-whitelist-categories: []
  max-suppressed-bytes-before-category-resync: -1

Dynamic Activation of Brain

This group makes distant entities update their AI less often. It reduces work when no player is observing the area.

KeyDefaultMeaning
enabledtrueMaster switch. Set it to false to use the upstream activation cadence.
start-distance12Distance at which activation frequency begins to fall.
activation-distance-mod8Distance-decay parameter. A lower value reduces distant-entity work earlier or more strongly.
maximum-activation-prio20Maximum interval. A distant entity is evaluated at least once every 20 ticks.

If a mob farm, villager hall, or redstone machine shows delay, lower activation-distance-mod or increase start-distance. Change one value at a time. Test the affected area.

Async Pathfinding

This group runs selected pathfinding work in asynchronous tasks. It reduces the chance that pathfinding blocks the current region tick.

KeyDefaultMeaning
enabledtrueMaster switch for async pathfinding.
async-pathfinding-keep-alive60Maximum active lifetime of a path task, in ticks.
async-pathfinding-max-threads20Async path pool size. DeerFolia uses virtual threads. The value does not reserve one physical core per thread.

Start with 10–20 threads. Too few threads can queue work. Too many threads can increase scheduling and GC pressure. If pathfinding is unstable or CPU or GC usage changes sharply, lower the pool size first. Restart after changing these options.

Kaiiju Entity Throttling

kaiiju-entity-throttling is the master switch. See Entity throttling for the file format. When the value is false, DeerFolia does not use limits in kaiiju-entity-throttling.yml. You can keep the file for later use. Test each limit before you add it.

Network Optimizations

This group has no separate enabled switch:

KeyDefaultEffect
optimized-var-inttrueOptimize VarInt reads and writes for packet length fields.
optimized-frame-encodingtrueOptimize network frame encoding and reduce outbound preparation work.

These options affect internal packet handling. They should not change player-facing features. If a proxy, compression plugin, or protocol problem appears, disable one option at a time on a test copy.

Lithium Optimize

This group uses selected Lithium server optimizations. It adapts them to Folia’s region-threaded model. enabled is the master switch. The other keys select groups:

KeyMain purpose
allocationsReduce temporary allocations in frequently called paths.
aiOptimize entity AI iteration.
collectionsUse lighter collection access in entity attribute paths.
entitySkip unnecessary entity work and client-only particle logic.
mathUse simpler math paths that the JVM can optimize.
worldOptimize world generation, weather, and freeze paths.

Restart the server after changing any option in this group. These options are not the complete Lithium feature set. They do not replace optimizations from Paper, Folia, or Moonrise. If entity, redstone, or weather behavior is wrong, set enabled to false on a test server before you change sub-options.

POI Optimizations

This group changes villager Point of Interest checks. The values use ticks or blocks:

KeyDefaultMeaning
enabledtruePOI optimization master switch.
golem-spawn-check-interval200Minimum interval between iron golem checks for one villager.
secondary-poi-sensor-interval80Minimum interval between secondary POI scans.
village-distance-cache-duration100Village-distance cache duration.
golem-spawn-player-distance-limit128Skip part of the golem check when no player is within this distance.

For a large villager area, start with the defaults and observe CPU usage. If an iron farm or workstation area depends on timing, lower the relevant interval or set enabled to false for a comparison.

AFK Network Optimization

When a player is inactive for the configured time, DeerFolia suppresses selected non-essential clientbound packets. It resynchronizes required state when the player becomes active. This saves bandwidth. It does not stop world logic for the player.

KeyDefaultMeaning
enabledtrueAFK network suppression master switch.
afk-threshold-ticks1200Enter AFK after this number of inactive ticks.
count-look-changes-as-activitytrueTreat look-only rotation as activity.
resync-on-resumetrueResend nearby chunks and tracked entities when activity resumes. Keep this enabled.
stats-enabledtrueAccumulate data used by /afknetstats.
suppression-whitelist-categories[]Categories that still pass while AFK.
max-suppressed-bytes-before-category-resync-1Per-player, per-category byte threshold. -1 disables forced refresh before activity resumes.

The supported categories are:

  • chunk-stream: chunks, light, and chunk-batch data;
  • block-updates: block, multi-block, and block-entity updates;
  • entity-stream: entity creation, movement, metadata, equipment, and attributes;
  • world-effects: sounds, particles, explosions, and world events;
  • ui-stream: BossBar, Title, TabList, scoreboard, map, and other UI synchronization.

Use the lower-case keys in suppression-whitelist-categories. Startup normalizes case, removes duplicates, and ignores unknown categories.

Entry and exit messages support legacy colors such as &7 and &a and hex colors such as &#55FFFF. Use these placeholders:

PlaceholderAvailable inMeaning
{player}entry and exitPlayer name.
{saved_traffic}exitTraffic saved during the AFK session.
{saved_bandwidth}exitPeak bandwidth saved during the AFK session.

Clear a message value to disable that notification. An administrator can view totals with:

/afknetstats
/afknetstats <player>

The command requires administrator permission. If a player sees a short desynchronization, check that resync-on-resume is true before you add categories to the whitelist.