

FishNoStub
A small modification module that fixes the problem of fish completely stopping movement in Minecraft, related to the official bug MC-182763.
Compatibility: Minecraft versions 1.17.x-1.20.x for Fabric (possibly Quilt) and Forge.
How It Works
Fish in the game have a special artificial intelligence system that scans nearby individuals and randomly selects a leader and followers. Then the follower fish begin to follow the leader.
This mod fixes an error in the FollowFlockLeaderGoal
code by adding a check: whether the nearest fish is a leader or not. If not, it is added to the follower list.
When a leader gets into the follower list, a problem arises: the leader fish stops and ceases to move along with its followers (forever!). This can only be fixed by hitting the fish or switching to survival mode and swimming close to them.
Additional Fixes
- Changing the entity predicate using
EntitySelector.NO_CREATIVE_OR_SPECTATOR
instead ofEntitySelector.NO_SPECTATORS
in the avoid entity goal - Setting the
checkNoActionTime
parameter tofalse
inFishSwimGoal
to eliminate fish getting stuck in one place - Decreasing the
schoolSize
value of the leader fish when a follower fish dies
Performance Impact
The mod does not improve game performance and has minimal impact on system operation, especially regarding fish behavior.
Installation
- Install Fabric Loader or MinecraftForge
- Copy the mod file to the
mods
folder
Creation Story
The author was working on the Fish of Thieves project, studying the FollowFlockLeaderGoal
code and converting it to work with the Brain
system.
When displaying debug information above an entity, it was discovered that a fish with a schoolSize=8
value had the property isFollower=true
and a leader, which is technically impossible. This observation became the starting point for creating this mod.