Re:Animal Performance Fix

Quick rating

Re:Animal Performance Fix

No reviews yet

Stops Re:Animal from sending pathfinding debug packets every tick and throttles the Brain AI of its decorative water mobs.

Bug Fixes
Performance & Optimization
Mod Loaders
NeoForge
Minecraft

Community voices

Reviews

Versions
Loading versions…
Match includes

Click once to include, again to exclude, again to clear

Rating Any
Any 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0
Min
Max
Play Status
Reviews
Time Played
hrs+
Verified developers only
Has developer response
List view
Grid view
Compact view
Sort by
Date
Rating
Helpful
Unhelpful
Edited
Sort ascending
Delete this review?

This removes your review from the project. You can write a new review after.

Review submitted for moderation

Your review has been sent to moderators, who will check that it meets our guidelines before it appears publicly.

No reviews yet. Be the first to review this project!

Get it on

Available Platforms

About

Project Details

Type
Mod
Latest Version
Re:Animal Performance Fix 1.0.0
Authors

For authors

Embed Badge

If you're the author of this project, you can embed a live badge anywhere that supports HTML or Markdown. It updates automatically whenever ratings change.

Custom banner text
ModDex rating badge preview

Use HTML for any page that supports it, or Markdown for README files and Markdown-based descriptions.

Identifiers

Platform IDs

CurseForge ID

Resources

External Links

Source Issues Wiki Discord

About

Description

Re:Animal Performance Fix

A small server-side fix mod for Minecraft 1.21.1 / NeoForge. It targets two specific performance problems caused by Re:Animal 0.6.0. It adds no items, no blocks and no entities — it only stops work that is being done for nothing.

Install it on the server only. Clients do not need it, and its absence on the client will not block anyone from joining: the mod registers no network payloads and no registry entries, so there is nothing to negotiate at connection time. Single-player and LAN worlds run an integrated server, so there it does need to be in the client instance.


Problem 1 — pathfinding debug packets in production

In vanilla Minecraft, DebugPackets.sendPathFindingPacket is an empty stub. It is called from PathNavigation.tick(), which means once per tick for every mob that currently has a path — but the body does nothing, because debug rendering is a development-only feature.

Re:Animal injects into that method and implements a real send. For every call it walks the level's entire entity list to find players, then serializes the mob's full Path and sends it to each one. On a populated server this is the single most expensive method on the tick loop.

Nothing consumes the result: Re:Animal's own client-side handler for the packet is an empty method, so every path is encoded, pushed through the network stack, decoded by the client and discarded.

This mod cancels the call before any of that happens.

In a profile taken from a live server, that one method accounted for roughly 15% of the server thread, of which about 4% was the write(2) syscall on the Netty event loop. Outgoing bandwidth drops accordingly.

Problem 2 — Brain AI on decorative mobs

Re:Animal's starfish and sea urchin are near-stationary decorative animals, but each one runs a full Brain AI — the same system villagers and piglins use — plus a WaterBoundPathNavigation, every single tick. In the same profile the starfish alone cost more than every zombie, skeleton, creeper and spider in the world combined.

This mod can run that decision-making once every N ticks instead (default: every 4th tick, offset by entity id so they do not all land on the same tick). Only Mob.serverAiStep() is skipped. Physics, movement, collisions, damage, air supply, breeding timers and despawn checks all still run every tick, so the mobs behave normally — they just re-decide less often.

Problem 3 — there are simply too many of them

Re:Animal registers starfish and sea urchin as MobCategory.CREATURE with a spawn weight of 25 and a pack size of 5–15, in every ocean and beach biome. That combination is worse than it looks:

  • CREATURE is the category Minecraft uses when populating freshly generated chunks, so a pack is placed in every new ocean chunk at world-gen time;
  • vanilla oceans have almost no CREATURE spawns to compete with, so weight 25 dominates the roll;
  • Animal never despawns, so the population only ever grows as players explore.

Two things address this:

  • A spawn-weight datapack is provided as a separate download. Drop it in <world>/datapacks/ and restart the server. It lowers the weights and pack sizes to values comparable with vanilla ocean fauna. Note that this only affects newly generated chunks.
  • despawnFarAway (on by default) lets starfish and sea urchins despawn like normal wild mobs when they are more than 128 blocks from every player. Named, leashed and otherwise persistence-required mobs are never touched. This is what cleans up a world that is already overpopulated.

Configuration

Everything is configurable and every fix can be switched off individually. The config is a NeoForge SERVER config, generated on first launch.

[pathfinding_debug]
    disablePathfindingDebugPackets = true

[ai_throttle]
    aiThrottleInterval = 4        # 0 or 1 disables the throttle
    aiThrottleEntities = ["reanimal:starfish", "reanimal:sea_urchin", "reanimal:pigeon"]
    skipAiWhenNoPlayerNearby = false
    playerRadius = 24

[despawn]
    despawnFarAway = true
    despawnFarAwayEntities = ["reanimal:starfish", "reanimal:sea_urchin"]

aiThrottleEntities is a plain list of entity ids, so the throttle is not actually tied to Re:Animal — you can point it at any decorative mob whose behaviour nobody watches closely. Do not point it at hostiles, pets or mounts.

Compatibility

All three mixins target vanilla classes (DebugPackets, Mob, Animal), not Re:Animal's own classes, so a Re:Animal update cannot break them. If Re:Animal is not installed, the DebugPackets mixin is not applied at all.

One known interaction: Moonlight Lib also injects into sendPathFindingPacket, for its /moonlight debug pathfinding renderer. That renderer does nothing unless an operator explicitly enables it, but while disablePathfindingDebugPackets is true it will show nothing. Set the option to false if you need it.

License

MIT. This mod contains no Re:Animal code.

Screenshots

Gallery

This project has no gallery images yet.

Versions

Files

Relations

Project Relations

More like this

Similar Mods

Suggestions use data such as tags, dependencies, dependents, descriptions, titles, and more to rank how much they overlap with this mod.

On ModDex

Community snapshot

0
Ratings
0
Followers
0
In stacks

By the numbers

Statistics

<1,000
Downloads
Last Updated
Created
Last synced
When ModDex last fetched this project from CurseForge or Modrinth. Every project is re-checked on a schedule, and any project that ships a new file is synced automatically within hours of the release.
New file updates sync automatically
How syncing works