promotional bannermobile promotional banner

AI Companion – LLM Player Bot (Ollama, ChatGPT)

An autonomous AI companion driven by your own LLM. It navigates, gathers, crafts, builds on request, and fights alongside you. Runs fully local with llama.cpp (nothing leaves your network) or any hosted OpenAI-compatible API. Singleplayer & LAN.
Back to Files

aicompanion-0.2.7.jar

File nameaicompanion-0.2.7.jar
Uploader
dauk808dauk808
Uploaded
Aug 6, 2026
Downloads
49
Size
4.9 MB
Mod Loaders
Fabric
File ID
8585944
Type
R
Release
Supported game versions
  • 1.20.1

Curse Maven Snippet

Fabric

modImplementation "curse.maven:ai-companion-fabric-1619582:8585944"

Learn more about Curse Maven

What's new

0.2.7 — Healing costs food, and it knows when to run

Bundles PlayerEngine 1.0.69. Self-contained jar as always — don't install a standalone engine alongside it.

Nothing to do after updating — four new behavior.* settings are added to your existing config file automatically, at the defaults described below. Your companions will need feeding now — read on.

It was healing faster than anything could hurt it

A companion regenerated a full heart every half second, forever, for free. Near-death to full in ten seconds. That is vanilla's fastest healing — the burst you get at full food and full saturation — and for a companion it was the permanent baseline rather than a brief window.

The cause was a shortcut with a sting in it. Healing was ticked, but the hunger cost of healing wasn't, on the reasoning that a companion with no reliable way to eat would starve. Except hunger draining is the only thing that makes food fall, so food sat at 20/20 forever, which is exactly the condition for the fastest regeneration — and, at the same time, the condition under which every attempt to eat is refused as unnecessary. The shortcut created the problem it was protecting against.

Healing now costs food, the way it does for you.

Eating, which turned out to have never worked at all

Making food drain revealed that nothing about eating actually functioned. Three separate faults, each hidden by the one before it:

  • A meal gave nothing back. Filling a hunger bar is something only players do, and a companion isn't one — so every item eaten was destroyed for no benefit.
  • The part of the mod that decides when to eat had never once run. It was only ever consulted when it already had a job on, and the only thing that could give it a job was being consulted — a circle it could never get inside. Everything to do with feeding itself sat behind that.
  • Feeding itself never happened. Automatic eating also worked by pretending to right-click, and that route is broken for a companion in a way that fails silently.
  • eat always refused. With food pinned at 20/20 there was never a reason to eat, so the command answered "already full" every time it was asked.

All three are fixed. A companion now eats by itself — visibly, over the normal few seconds, with the sound and the crumbs — and keeps going until it's full rather than taking one bite. Asking it to eat does the same thing in one go instead of once per mouthful.

It tops up while it's safe, rather than waiting until it's desperate. The old rules only counted a companion as hungry once it was badly hurt or nearly starving. Watching one stand at full health with food to spare and a pack full of meat for the best part of a minute, then walk into a fight and die still holding it, made the problem plain. It now tops up between fights instead.

And it can eat mid-fight when it needs to. Eating means holding food for a second and a half, and until now anything else that wanted a weapon in hand would cancel the mouthful before it finished — so a companion in trouble could reach for food repeatedly and never actually swallow. Combat now pauses for the bite and picks straight back up, the way you'd swap, eat, and swap back yourself. It won't stand there topping off to full while something is shooting at it, though; in a fight it takes what it needs and gets back to work.

Rotten flesh is good food for a companion, and it now knows that. It never made them ill in the first place — the nausea is something the game only applies to players — but the companion had inherited a person's instinct to avoid it and treated it as a last resort. Since it's what actually drops from the things a companion fights, that made it needlessly fussy. Spider eyes are still avoided, and correctly: poison does affect them.

It eats the moment hunger is what's stopping it healing. Below 18 food nothing regenerates, so a companion sitting just under that line is not peckish — it's stuck at whatever health it has until it eats. It now treats that as urgent and eats regardless of how much of the meal goes to waste; three points of pork is worth less than four hearts.

And it understands why it isn't healing. Below 18 food nothing regenerates at all, so a companion that's hurt and hungry sits at the same health indefinitely. It couldn't work out that eating was what unblocked it — health and hunger were both in front of it, but not the connection between them. It's now told plainly when it isn't healing and what to do about it, so a hurt companion reaches for its own food instead of standing there waiting to feel better.

It picks up food it walks past, and clears up after a kill. A companion only ever collected what it was standing directly on, so anything that landed a step away stayed there — it could clear out a herd of pigs and go hungry later beside the pork it earned. It now walks over and collects dropped food within 16 blocks. Only food, only once nothing is hunting it, only with a free slot, and never in preference to a job you've given it, so the tidying happens when the work is done rather than instead of it. Spider eyes are left alone; poison affects them even though rotten flesh doesn't. Turn it off with behavior.scavengeFood, or change the range with behavior.scavengeRadius.

It still won't go foraging on its own — food remains something you ask for. That's deliberate for now; a companion that wanders off hunting on its own initiative is a bigger change than this one.

Effort makes them hungry, not just injury. Healing was the only thing that cost a companion anything, which meant one that stayed unhurt could cross the world, mine out a hillside and win a run of fights entirely for free — a test run had saturation sitting at exactly the same number through eight minutes of hard work. Sprinting, swimming, jumping and swinging a weapon now cost what they cost you. Plain walking is still free, same as it is for you.

A hungry companion stops healing and waits. It will not starve to death. Running out of food has a real consequence without turning "you went to bed" into a corpse in the morning.

Hunger resets when the world reloads, deliberately. The cost that matters is the one inside a session, and starting a session already starving through nobody's fault is worse than the exploit of quitting to top your companions up.

A readout for how they're doing

New panel in the top-right corner, one line per companion:

  Ava    ██████████ 15   ██████████ 17
  Rook   ██████████ 20   ████░░░░░░  9

Health on the left, hunger on the right, with the number beside each. The health bar goes green → amber → red as it drops. The hunger bar carries a thin lighter line across the top for saturation — that's the hidden buffer healing spends before hunger itself moves, so it's the first thing to watch if you want to see a fight costing them something.

It stays out of the way by default, appearing only when somebody is hurt or getting hungry and fading again once they're fine. /companion hud cycles that to always-on, then off entirely, then back.

Works at any distance — it rides the same signal as the locator bar, so a companion off working across the map still reports in. A row greys out and marks itself if it's gone quiet or is in another dimension, rather than silently showing you a stale reading.

It wears the armour you give it

Hand a companion a full set of diamond and it used to carry it around and keep fighting in its shirt. Armour was only ever put on if you asked for it by name, and nothing said otherwise — the set just sat in the pack.

It now puts on anything better than what it's wearing, checking about once a second. Defence, toughness and Protection all count, so it won't swap a good piece for a worse one, and whatever comes off goes back into the pack rather than being lost. Durability is ignored on purpose: a nearly-broken diamond helmet protects exactly as well as a fresh one right up until it breaks.

Turn it off with behavior.autoEquipArmor if you'd rather decide yourself.

And it can finally use a shield

A companion has always had the code to raise a shield — against a swelling creeper, against incoming arrows, against something in melee range. None of it had ever worked. Give a companion a shield and it would keep it in the pack forever and take every hit unblocked, while the mod believed it was blocking.

Three faults, stacked:

  • The shield never reached the offhand. The routine meant to put it there had an off-by-a-whole-list error and was writing into the first slot of the pack instead. So every shield check sat permanently at "no shield in the offhand yet", shuffling the pack each tick and never getting anywhere.
  • Raising it did nothing. Blocking was done by pretending to hold right-click — the same dead route that stopped companions eating, in a second place. It only ever does anything while the companion is looking directly at a block, and even then it fails silently.
  • It braced for a hit it wasn't blocking. Whenever raising the shield failed, the companion still stopped moving, crouched, and stood its ground in front of whatever was attacking it. All of the commitment, none of the protection. It now only holds still if the shield is actually up.

All three are fixed, and a carried shield now lives in the offhand permanently rather than being scrambled for once the arrow is already in the air. If you've put something else in the offhand, that stays — the shield waits.

Shields wear out now, too. Blocking worked out to be free: damage was stopped exactly as it is for you, but the shield never lost durability and could never break. That's a permanent advantage no player has. A companion's shield now takes the same wear yours does, and breaks the same way.

And eating beats blocking. Raising a shield and eating are the same kind of action underneath, and only one can be happening at a time — so the first thing working shields did was stop a companion mid- fight from ever getting a mouthful in. It would set out to eat, be quietly refused, and stand there hungry with the shield up. Food wins that tie now: the shield drops for the second and a half the meal takes and is back up straight after.

behavior.defenseUseShield turns the whole thing off, and correctly makes it fight more cautiously, since it knows it's going in without one.

It runs when it's hurt, not when its gear looks weak

The decision to retreat never once looked at how injured it was. It compared its equipment against how many things were attacking it — so a companion on its last heart with a diamond sword would stand and fight a zombie, while an uninjured one with empty hands would run from the same zombie.

That was survivable while it could stunlock anything it touched. 0.2.6 took that away, and left nothing that made a hurt companion disengage.

Injury now counts. The same equipment picks a smaller fight when the companion is half dead, and below a quarter health it runs regardless of what it's holding.

It's also braver than it was. The sums behind that decision came from a speedrunning bot, whose best play is to dodge every fight it possibly can — taken at face value it reckoned an unarmoured companion with a wooden sword could handle exactly one hostile. In testing that meant fleeing, at full health, from a spider and a zombie it then killed without difficulty the moment being cornered forced it to try. Companions have a player's stat line now, and a player at full health handles two ordinary mobs comfortably, so the maths now credits the body itself and not just the kit. Tune it with behavior.defenseBravery — 2.0 by default, 0 for the old caution, higher for a companion that stands and fights.

There's no "return to battle" behaviour and deliberately so. It heals as it retreats, and the same judgement runs continuously — so if something chases it and it has recovered enough to win, it turns and fights, exactly as it would have to begin with. Still hurt, it keeps going. What you'd expect happens without a system built to make it happen.

Talking to all of them at once

Addressing one companion by name has worked for a while — Ava: follow me reaches Ava and nobody else. There was no way to say something to the whole group short of saying it twice.

Open with all: and every companion in earshot gets it:

all: team up and fight together
everyone: back to base
both: stop what you're doing
team: spread out and look for the cave

all, everyone, both and team all work, and each companion is told the line went to the group rather than to them alone — so they divide the work instead of both doing the same thing, and don't answer on each other's behalf.

The colon (or a comma) is required, and that's deliberate: those four are ordinary ways to start a sentence, and without it "all good" or "both of us made it" would fan out to the whole roster and buy a reply from every one of them. A name doesn't need the colon — Ava follow me still works — because a name rarely opens a sentence that isn't aimed at that companion.

Worth knowing this is the one form that costs a reply per companion, so the game tells you who it went to when you use it.

Cornered means fight

Backed into a dead end, walled in, or fenced, a retreat that gets nowhere for two seconds turns into a fight. Standing still while something hits you is strictly worse than swinging back.

This is decided instantly and locally rather than by asking the model — a companion that has to think about whether to defend itself is dead before it finishes thinking.

stand_ground — telling it a fight is worth it

New command, for the model rather than for you:

stand_ground        # 30 seconds
stand_ground 60     # up to 300

It suppresses retreat for that long, then expires on its own. This is the part worth handing to the companion's judgement: it can't react inside a fight, but it can decide beforehand that this one matters — holding a doorway while you get clear, protecting something, buying time. Self-preservation returns by itself, so a companion can't be talked into dying for a fight everyone has forgotten about.

It's told plainly that it doesn't need this for being cornered; that's already handled.

You'll also see it mention when it retreats and why, so its decisions aren't silent.

Note: all of the above only bites if behavior.defenseFleeFromHostiles is on, which it still isn't by default. Turn it on when you want a companion that runs.


0.2.6 — It fights like a person now

Bundles PlayerEngine 1.0.56. Self-contained jar as always — don't install a standalone engine alongside it.

Nothing to do after updating. A new combat block appears in aicompanion.json with your existing settings untouched. Companions you already have will get weaker, on purpose — read on.

It was fighting with a zombie's stat line

A companion is built on a zombie's attributes, which is a sensible starting point for health and movement and a bad one for combat. A zombie has 3.0 attack damage where a player has 1.0, and 2.0 armour where a player has 0.0. Nothing announced this and nothing asked for it.

So before picking anything up, a companion hit three times as hard bare-handed as its owner, and that advantage rode on top of every weapon — a diamond sword in its hand did 10 damage where the same sword in yours does 8. It also walked around wearing two invisible points of armour.

All three are now exactly a player's. A companion is dangerous because of what it's holding, which is the only reason it should ever have been dangerous.

Follow range came down too, from 35 blocks to 16. That number decides how far away it will notice something worth fighting; 35 is a monster's aggro radius and is far enough that a companion standing still starts fights with things nobody has seen yet.

It was swinging four times a second, at full strength

Separate defect, same symptom, and this was the one making combat look like one-hit kills.

A weapon has a cooldown — the reason a real sword fight is a rhythm rather than a blur, and the reason spam-clicking in vanilla does almost nothing. The companion's melee routine was told that cooldown was a flat five ticks no matter what it held. A diamond sword's actual figure is twelve and a half.

The effect wasn't quite what it looked like. It wasn't hitting harder per swing; it was hitting two and a half times as often as the weapon allows, every one of them fully charged. And because knockback lands on every swing, whatever it was fighting got knocked back before it could act, then knocked back again, and never got a turn. Nothing was being one-shot. Things were being held down until they died, which is arguably worse to watch — the fight never looked contested.

It now reads the weapon's real attack speed, so a companion swings at the rate a player holding the same thing would. The "hit everything in range" strategy, which isn't on by default, was also skipping the cooldown entirely; it no longer does.

Deflecting ghast fireballs is deliberately left alone. That has no charge-up, a player does it by spam-clicking, and the window is short enough that waiting out a cooldown means eating the fireball.

Expect your companion to be noticeably worse in a fight, and to start taking real damage. That is the change working. It also means the eating, shielding and defensive behaviour is being properly exercised for the first time — if something there misbehaves, this release is why it surfaced.

You can make it stronger, on purpose

The four numbers are yours now, under a new combat block:

combat.attackDamageBase   (1.0 — player parity)
combat.armorBase          (0.0)
combat.maxHealth          (20.0)
combat.followRange        (16.0)

Raise them if you want a tougher companion for a hard modpack — that's a perfectly reasonable thing to want. The point of this release isn't that companions must be weak, it's that the advantage has to be asked for rather than handed over quietly. Changes apply to live companions on /companion reload, no restart needed.

It can no longer reset its own memory

Four commands were being offered to the companion as things it might choose to do: wiping its own conversation memory, switching its own brain off, reloading settings, and a leftover beat-the-game routine. Two of them already carried the note "can ONLY be run by the user (NOT the agent)" — which was the only thing enforcing it, i.e. nothing was.

A companion talking itself into a fresh start and forgetting the afternoon is not a hypothetical worth waiting for. They're no longer listed to the model, and they're refused if it asks for one anyway. You can still run all four yourself; nothing you could do before has been taken away.

Smaller side benefit: four fewer commands described in full on every single request to the model.

This mod has no additional files