Skip to content
XiaoYangx666Public

About

TypeScript framework for Minecraft Bedrock games and gameplay Addons.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Repository files navigation

BEGame

Verify MIT QQ

A framework for building games and gameplay Addons on Minecraft Bedrock.

English · 简体中文

BEGame is a TypeScript game framework built on Minecraft Bedrock Script API. It brings game instances, state-driven workflows, reusable components and player participation into a shared runtime structure.

Why BEGame?

  • Give every resource an owner. State-scoped event subscriptions, components and managed runners are released when their state ends. This makes cleanup part of the game's structure.
  • Reuse behavior across games. Compose timers, region protection, player interaction policies, displays and room cleanup as components, then add game-specific behavior through the same model.
  • Run multiple instances in one world. Each instance has its own context, state tree and player manager. Participation policies coordinate membership across games within a Script runtime.
  • Make lifecycle bugs reproducible. Use the headless test host to execute the actual framework and exercise transitions, reconnects, timeouts, rollback and resource cleanup.
  • Inspect what happened. Optional Trace records lifecycle and developer-defined business events. Observatory provides a local workbench for session inspection and export.
  • Keep integrations explicit. Built-in server integration and platform-specific Trace bindings have separate entry points. Bundle checks guard the boundaries of optional features.

Core ideas

A game owns a session. A state owns a phase. A component owns a behavior.

flowchart LR
    Manager[GameManager] --> Engine[GameEngine]
    Engine --> Context[GameContext]
    Engine --> Players[Player participation]
    Engine --> State[GameState tree]
    State --> Components[GameComponent]
    State --> Resources[Events and managed runners]
Loading

Model phases as states and reusable behavior as components. Keep game rules and match data separate from runtime resources and presentation, with explicit game-owned persistence and recovery.

Get started

npm install @begame/core

The behavior pack supplies the Minecraft peer dependencies and bundles BEGame into its script entry. Follow the getting started guide, then read architecture and ownership and the game authoring tutorial.

Use the documentation index to find component, room lifecycle, testing and Trace guides. Detailed gameplay tutorials are currently in Chinese.

Packages

Package Purpose
@begame/core Game lifecycle, states, components and participation
@begame/test Headless lifecycle testing with Vitest
@begame/trace-spec Shared Trace vocabulary and types
@begame/trace Trace codec, sessions, history and platform bindings
@begame/observatory Local Trace inspection workbench and CLI

Install the packages you need and keep installed BEGame packages on the same release version.

Community

See PartyGames for a game project built with the framework.

Report bugs or propose improvements through this repository's Issues and Pull Requests. Chinese community: QQ group 1004513100.

MIT licensed. Release maintainers: see the release guide.

About

TypeScript framework for Minecraft Bedrock games and gameplay Addons.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages