Files
minecraft-bot/docs/cache_items.md
T

46 lines
1.7 KiB
Markdown

# How to Cache Items
Caching normally starts when the bot has at least 27 occupied inventory slots.
Jobs can run cache passes automatically; `1cache` requests a pass directly.
## Destination priority
A cache pass handles destinations in this order:
1. **Throw signs** — addressed `throw` directives drop matching inventory stacks
near their signs.
2. **Item-specific chests** — signs labeled `Seeds`, `Wheat`, `Logs`, `Saplings`,
or a tree family such as `Oak Logs` direct matching items to nearby chests.
3. **General cache chests** — a normal chest marked with a bot-addressed `cache`
sign accepts any otherwise-cacheable items. These are lower priority than
all item-specific chests, regardless of distance.
4. **Placed chest** — if no signed chest destination is usable, the bot places a
normal chest from its inventory when it has one.
Unmarked trapped chests are no longer searched for or used as cache destinations.
See the [Signs section in the main README](../README.md#signs) for sign syntax,
addresses, category contents, and examples. General cache signs look like:
```
mosfet cache
```
or, for one bot only:
```
mosfet1 cache
```
The bot searches for signed cache chests within 105 blocks. Chest attachment,
side-over-top priority, double-chest handling, and bot-group addressing follow
the same rules as other signs described in the README.
## Items kept
Items in the current job's `NEEDED_ITEMS` set are kept in general cache passes.
For `WANTED_ITEMS`, the bot keeps one stack of each type and may cache extras.
Item-specific chests only accept their labeled item IDs, while general cache
chests accept all otherwise-cacheable items. The normal cache threshold is
controlled by `g.minimum_cache_slots` in `mosfet.py` (default 27).