Core Topics

Deep dive into Pilaf internals and implementation details.

Components

Key Concepts

Variable Storage

Store step results and reference them later:

// Store result
{ action: 'get_player_location', player: 'p', store_as: 'pos' }

// Reference stored value
{ action: 'calculate_distance', from: '{pos}', to: '{new_pos}' }

Backend Pooling

Pilaf maintains a pool of backend connections:

  • backends.rcon - Single RCON connection

  • backends.players - Map of username → MineflayerBackend

Resource Lifecycle

  1. Setup → Connect backends, create bots

  2. Steps → Execute actions using backends

  3. Teardown → Disconnect everything (ALWAYS runs)

For Contributors

Interested in contributing to Pilaf?

  • Code is in packages/ directory

  • Tests are in tests/ directory

  • Use pnpm test to run tests

  • Follow existing code patterns

Need More?


Table of contents


Back to top

Copyright © 2025 Pilaf Contributors. Open source under the MIT license.

This site uses Just the Docs, a documentation theme for Jekyll.