# FAQ and troubleshooting

Answers to common questions, and what to do when a bot doesn't behave the way you expect.

import { AccordionItem, Accordions } from '@prosefly/astro-components';

## General

<Accordions>
  <AccordionItem title="Does AI Players use ChatGPT or another AI service?">
    No. Bots run on hand-written game logic, entirely on your server. Nothing is sent anywhere, so it works offline
    and it's free to run.
  </AccordionItem>
  <AccordionItem title="Do players need to install the mod?">
    No. Only the server needs it. Players join with a regular Minecraft client and see bots as normal players.
    Installing it on your own game is optional and gives you the
    [client add-on](/ai-players/guide/client-add-on/): a management screen, an orders screen, a debug overlay and
    custom skins for bots.
  </AccordionItem>
  <AccordionItem title="Does it work in singleplayer?">
    Yes. Install it like any Fabric mod and play in a world with cheats allowed, so you can use the `/aiplayer`
    command. The [client add-on](/ai-players/guide/client-add-on/)'s screens work there too, with nothing else
    installed. See [Installation](/ai-players/guide/installation/#in-singleplayer).
  </AccordionItem>
  <AccordionItem title="Does it work with other mods?">
    Mostly, yes. Bots read the game's own data, so modded recipes, foods, logs, ores in the common `#c:ores/*`
    tags and crops in `#minecraft:crops` work without any setup. A mod's machines need a small plugin that
    describes them, and a mod's tools and armor can be added as rungs of the gear ladder the same way. An adapter
    for Tech Reborn is in the works. See [Mod integration](/ai-players/reference/mod-integration/) and the
    [roadmap](/ai-players/guide/roadmap/#tech-reborn-and-tech-extensions).
  </AccordionItem>
  <AccordionItem title="Can bots chat or answer me?">
    A little. Bots in a faction use the faction's team chat to [call each other for help](/ai-players/guide/factions/#calling-for-help)
    and to answer yes or no, and you can answer their calls with `/teammsg yes` or `/teammsg no`. A bot that sees
    you rob its base also tells you so in chat, once. Other than that, they only reply to commands and orders
    through command feedback. You can't have a conversation with them.
  </AccordionItem>
  <AccordionItem title="Do bots cheat?">
    Not unless you let them. Bots mine, craft, fight, trade and raid by the same rules as you. Optional cheats
    (a starting kit, periodic item gifts, and revealed enemy base knowledge) exist, but they're off unless the
    server owner allows them and an operator enables them per bot. See
    [Difficulty and cheats](/ai-players/guide/difficulty/#cheats).
  </AccordionItem>
  <AccordionItem title="Can bots go to the Nether or the End?">
    Yes, both. Play styles with `nether.travel` enabled (like the shipped
    [Boomer](/ai-players/guide/play-styles/#boomer) and [Flanker](/ai-players/guide/play-styles/#flanker)) build and
    light a Nether portal at their base and set up a camp on the other side. There they wear gold boots to keep the
    peace with piglins, explore fortresses for blaze rods and nether wart, raid bastions for smithing templates,
    mine ancient debris for netherite, and brew potions. See [The Nether](/ai-players/guide/nether/).

    Styles with `end.travel` (the shipped [Rusher](/ai-players/guide/play-styles/#rusher) and Boomer) go to the End
    as a faction once their gear is done. They hunt eyes of ender, find the stronghold by throwing them, fight the
    dragon, bring the egg home, and go back for an end city's elytra. See [The End](/ai-players/guide/the-end/).
    Bots on the Easy difficulty never go.
  </AccordionItem>
  <AccordionItem title="Can bots fly?">
    Only with an elytra they looted from an end ship and firework rockets they crafted. A bot puts the elytra on
    for the flight and swaps its chestplate back on when it lands. It flies on long trips home, on explore trips
    and, for the Flanker, on its raids. See [Flying with an elytra](/ai-players/guide/the-end/#flying-with-an-elytra).
  </AccordionItem>
</Accordions>

## Bots and your world

<Accordions>
  <AccordionItem title="A bot took logs from my house! How do I protect my builds?">
    Bots only chop logs that look like they belong to a tree, and only mine natural stone. The check can be fooled,
    though. A log cabin under a tree, or a wall of natural stone, may look like nature to them. A few options:

    - Build bases away from bots' homes.
    - Use a claim or protection mod. Bots break blocks the same way players do, so protected areas stop them.
    - Ask an operator to switch the bot's brain off near your build with `/aiplayer debug <bot> auto off`.
  </AccordionItem>
  <AccordionItem title="Bots keep playing when I'm offline. Is that normal?">
    Yes, that's by design. Bots load the area around them like players, so their base keeps growing while you're
    away. It also means each bot keeps its surroundings loaded, like an extra player would.
  </AccordionItem>
  <AccordionItem title="Do bots stop the night from being skipped?">
    No. Bots never count toward the sleep vote, so real players can skip the night whatever the bots are doing.
    When every real player online is asleep in bed, any bot that has a bed walks to it and lies down too, so the
    skipped night finds it in bed.
  </AccordionItem>
  <AccordionItem title="Do bots take up player slots?">
    No, not by default. Bots count toward the online number shown in the server list, but they don't stop real
    players from joining a full server. Server owners can change both in the
    [server configuration](/ai-players/reference/server-config/).
  </AccordionItem>
  <AccordionItem title="Will bots kill my pets or farm animals?">
    Bots hunt animals for food, but never one with a name tag or on a lead. Name your favorite animals and
    they're safe. Once a bot has two iron ingots to spare for shears, it mostly shears sheep instead of killing them.
  </AccordionItem>
  <AccordionItem title="A bot called me its enemy after I opened its chest. Why?">
    Because it saw you do it. If a bot watches a neutral player open one of its base's chests, break a block of its
    buildings or trample its crops, it holds a grudge as if you had hit it, and says so in chat. A bot with no
    faction counts *you* as a neutral too. To hand items to a bot through its chest, put yourself and the bot in
    one faction first. See [Offenses in the base](/ai-players/guide/combat/#offenses-in-the-base).
  </AccordionItem>
  <AccordionItem title="I can't see players of other factions on the locator bar. Why?">
    By design. A player in a faction sees only their own faction's members on the locator bar, in the faction's
    color, and is never sent to anyone of another faction, whatever the relation. Bots find their enemies with
    their own eyes, so you get the same rule. A player with no faction sees and is seen by everyone. Set
    `show_other_factions_on_locator_bar` to `true` in the
    [server configuration](/ai-players/reference/server-config/#visibility) for vanilla's bar.
  </AccordionItem>
  <AccordionItem title="I speed the server up with /tick rate and the bots get slow. Why?">
    How long a bot may search for a path is measured on the wall clock. At the default
    [bot clock](/ai-players/reference/server-config/#the-bot-clock) of `20`, bots keep thinking at a human pace when
    the world speeds up, like players would, so a search costs more ticks. Set `bot_tick_rate` to `"game"` in the
    config (or run `/aiplayer tick rate game`) and bots follow the server's tick rate like mobs do. Set it to a
    number to make every bot sharper or slower on purpose.
  </AccordionItem>
</Accordions>

## Fights

<Accordions>
  <AccordionItem title="A bot keeps attacking me. Why?">
    Either your factions are enemies, or the bot holds a grudge because you hurt it (or one of its faction mates)
    recently or it saw you rob its base. Make your factions neutral or allied, or wait for the grudge to wear off
    (10 to 30 minutes for the shipped play styles). See [Combat and safety](/ai-players/guide/combat/). If your
    faction is its enemy and you emptied one of its chests, expect its faction to hunt you and raid you back
    ([the counter-raid](/ai-players/guide/raiding/#the-counter-raid)).
  </AccordionItem>
  <AccordionItem title="I ran away from a bot and it chased me down!">
    That's what a good player does. Once you move away from a bot that can see you, it sprints after you and swings
    at your back. It keeps going until you gain 24 blocks on it, it loses sight of you for three seconds, its health
    gets low, or the chase has led it too far from home. If you stand still behind a fence or on a ledge, it
    doesn't chase you.
  </AccordionItem>
  <AccordionItem title="An enemy bot runs away from me instead of fighting.">
    You're better equipped than it is. Bots only start a fight they think they can win. They keep their distance
    from enemies who outgear them until their own gear catches up or they have friends around.
  </AccordionItem>
  <AccordionItem title="How do I make bots completely harmless?">
    Turn off PvP with `/gamerule pvp false`. Then no bot will fight a player or another bot, and no bot will raid
    anyone either. Players in creative or spectator mode are never attacked.
  </AccordionItem>
  <AccordionItem title="Can bots raid my base and steal from my chests?">
    Only if three things line up. The bots belong to a faction at war with yours (`enemy`), they have a raiding
    style like the shipped Flanker, and your base is *confirmed* as yours. Confirming it takes an enemy bot catching
    the owners at it: opening a chest there, sleeping in a bed there, or being seen at home on three separate
    occasions. A grudge alone never sends anyone after your chests, and a player without a faction is never a raid
    target. Raids also need PvP on and come at night, and raiders may tunnel under your wall rather than walk
    through the gate. Only plain chests and shulker boxes get looted (a box is carried off whole), so barrels and
    ender chests are safe. A protection mod stops a raid the same way it stops a player. See
    [Raiding enemy bases](/ai-players/guide/raiding/).
  </AccordionItem>
  <AccordionItem title="A bot stands at the edge of my base, watching it. What's it doing?">
    Scouting, most likely. Raiding styles watch the bases of enemy factions they suspect, trying to catch the
    owners using them, since that's the evidence that makes a base raidable. An operator can confirm with
    `/aiplayer info <bot>`, which shows an `objective: scout` line. Being seen inside your base is the evidence it's
    waiting for, so leave it nothing to see. Make the factions neutral or allied and you're off its list for good.
  </AccordionItem>
</Accordions>

## Troubleshooting

<Accordions>
  <AccordionItem title="My bot is stuck or idle. What do I do?">
    First, check what it's doing with `/aiplayer info <bot>`. The objective and task lines say what it's working
    on, and the last failure says what went wrong. If a bot stands still for a minute doing nothing, its task fails
    as `stalled` and the server log names what it was doing and where. If that happens again, the bot walks out to
    open ground. A bot that keeps moving without getting anywhere (pacing between two blocks, bouncing up and down
    a column) is caught too: after two and a half minutes within eight blocks of one spot with nothing changed, it
    climbs an **escape ladder**, trying a walk out, then a relocation to the nearest safe place it knows, then
    another, and asks its faction for help after three failed relocations. `info` shows `stuck: <rung>` while it
    climbs. Bots dig or pillar themselves out of holes on their own, but you can always bring one to you with
    `/aiplayer tphere <bot>`. With the [client add-on](/ai-players/guide/client-add-on/#the-debug-overlay), press U
    on the bot to see its path and task drawn in the world. If nothing helps, `/aiplayer debug <bot> auto off`
    followed by `auto on` makes it start fresh. To report it, turn on `debug_logging` in the
    [server configuration](/ai-players/reference/server-config/#debug-logging) and send `logs/debug.log` along
    with the `info` output.
  </AccordionItem>
  <AccordionItem title="The bot doesn't do something its play style should do.">
    Most activities need something first: a house before a farm, iron before a bucket or golems, a village before
    trading, enchanted gear at the style's goal before the End. Give it time, or check `/aiplayer info <bot>` for
    the last failure and its reason (for the End, its `end:` line says what it still lacks).
  </AccordionItem>
  <AccordionItem title="My bot went to the End and never came back.">
    The only way home from the End is the exit portal, which opens only when the dragon dies. A bot whose party was
    cut short keeps fighting from the island until the dragon is dead, calling its mates and resting at its arrival
    point when hurt. From the outer islands, it needs an ender pearl to come back through the gateway. An operator
    can always bring it home with `/aiplayer tphere <bot>`. See
    [The End](/ai-players/guide/the-end/#through-the-portal).
  </AccordionItem>
  <AccordionItem title="My custom play style doesn't show up.">
    Run `/aiplayer profile list`. Files that failed to load are listed there with the reason. A misspelled key or
    an out-of-range value makes the whole file fail. Bots that use a broken style fall back to
    `aiplayers:neutral`. See [Play style files](/ai-players/reference/play-style-files/).
  </AccordionItem>
  <AccordionItem title="I can't /kick or /ban a bot.">
    That's expected, since vanilla's kick and ban don't apply to bots. Use `/aiplayer remove <bot>` instead.
  </AccordionItem>
  <AccordionItem title="A real player has the same name as a bot.">
    The real player always wins. When they log in, the bot is retired. Spawn the bot under a different name, or
    bring it back with `/aiplayer respawn <bot>` once the player has left.
  </AccordionItem>
  <AccordionItem title="My bots and factions were gone after a restart.">
    The roster file couldn't be read. Every start that loads any bot or faction from
    `<world>/data/aiplayers/roster.dat` first copies it to `roster.dat_old`, and a start that loads none warns in
    the log and says how to restore. Stop the server, copy `roster.dat_old` back over `roster.dat` and start again.
    (If you had removed every bot yourself, the warning is just that.)
  </AccordionItem>
  <AccordionItem title="The server is lagging with many bots.">
    Each bot costs about as much as an extra player, plus its AI. Check `/aiplayer stats` for how much time the
    AI uses, reduce the number of bots, or lower `max_bots`, `ai_tick_budget_ms_per_bot` and `ai_tick_budget_ms`. See
    [Server configuration](/ai-players/reference/server-config/). The AI budget is a share of each server tick no
    matter the bot clock, so speeding bots up with `bot_tick_rate` never raises how much they can cost the server.
  </AccordionItem>
</Accordions>

Still stuck? Report it on the mod's [CurseForge](https://www.curseforge.com/minecraft/mc-mods/minecraft-ai-players)
or [Modrinth](https://modrinth.com/mod/minecraft-ai-players) page, with the output of
`/aiplayer info <bot>` and `/aiplayer stats` taken while it misbehaves, the `(aiplayers)` lines of
`logs/latest.log` (the startup line names the build), and `logs/debug.log` if you had `debug_logging` on.
