# adr-hyng-oss/lumber-axe architecture

> Architecture diagram of the GitHub repository adr-hyng-oss/lumber-axe, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/adr-hyng-oss/lumber-axe
- Repository: https://github.com/adr-hyng-oss/lumber-axe

## Overview

The Lumber Axe project is a Minecraft Bedrock addon that provides a unique tool—a lumber axe capable of felling an entire tree when any connected log is broken. The project is distinctly split into two main add-on components used by Minecraft: the Behavior Pack (BP) and Resource Pack (RP). In addition, there is a source directory (src) comprising TypeScript/JavaScript code that likely serves as the development version and/or a build pipeline for creating or managing the final add-ons. There are also auxiliary folders such as tools (with Python scripts) and guidelines (for documenting standards and thumbnails).

##### Main Components
- Behavior Pack (BP):
- Contains entity definitions, functions (mcfunction scripts for in-game logic), items (JSON definitions for different types of lumber axes), recipes, and additional scripts providing custom behaviors.
- Resource Pack (RP):
- Provides visual and audio assets including animation controllers, animations, textures, models, particles, language files, and render controllers. This defines the “look and feel” for the add-on.
- Source Code (src):
- The src directory mirrors much of the behavior pack’s logic in TypeScript. It organizes key classes, commands, configurations, functions, modules, and utilities. This directory likely serves as the development environment from where the final add-on components are built/updated.
- Tools:
- Contains build and configuration processing scripts (in Python and others) to automate the creation and validation of manifests and config files. These act as auxiliary modules driving the build/deployment pipeline.
- Guidelines & Documentation:
- Provides best practices, item-recipe details, thumbnails, and installation instructions, supplemented by a comprehensive README that instructs on installation and usage.

##### Relationships and Interactions
- The Minecraft Client (or game engine) loads both the Behavior Pack and Resource Pack. The game then uses the behavior pack’s scripts (MCFunction files and JS/TS logic) to trigger game events and actions.
- The resource pack supplies animations, textures, models, and sounds that visually represent the behavior-driven changes.
- The source code (src) serves as a development reference and build backend. It processes business logic, configurations, and modular “vanilla-types” that interface with Minecraft’s entity and item systems.
- Build tools (in tools/) and configuration scripts integrate changes from src into the final BP/RP package, ensuring manifests and configurations are correct.

##### Architectural Patterns & Design Principles
- Separation of Concerns:
- Clear split between game logic (BP and src) and visual representation (RP). This separation allows independent updates—changes in behavior logic won’t necessarily affect assets.
- Modularity:
- The project is subdivided into focused modules such as command handling, configuration management, custom item types, and utility libraries. This modular approach is visible both in BP/scripts and src.
- Consistent Naming & Configuration:
- The presence of manifest files, configuration directories, and guidelines indicates a disciplined configuration management and packaging process for Minecraft add-ons.
- Build Pipeline:
- The tools directory suggests an automated process to sync, process, and build configurations and manifests for deployment into Minecraft’s required formats.

## Diagram (Mermaid)

```mermaid
graph TD
    M["Minecraft Client"]:::runtime

    subgraph "Behavior Pack – Game Logic"
        BP1["Functions (mcfunctions)"]:::runtime
        BP2["Items (JSON)"]:::runtime
        BP3["Recipes"]:::runtime
        BP4["Entities"]:::runtime
        BP5["Scripts"]:::runtime
    end

    subgraph "Resource Pack – Visual Assets"
        RP1["Animation Controllers"]:::runtime
        RP2["Animations"]:::runtime
        RP3["Models"]:::runtime
        RP4["Textures"]:::runtime
    end

    subgraph "Source Code (Development)"
        SRC1["Core Classes"]:::dev
        SRC2["Commands"]:::dev
        SRC3["Configuration"]:::dev
        SRC4["Functions (TS)"]:::dev
        SRC5["Modules"]:::dev
        SRC6["Utilities"]:::dev
    end

    subgraph "Build Tools"
        TB1["build.py"]:::build
        TB2["process_config.py"]:::build
        TB3["process_manifest.py"]:::build
    end

    subgraph "Guidelines & Documentation"
        G1["README.md"]:::docs
        G2["Contribute Guidelines"]:::docs
    end

    M -->|"Loads"| BP1
    M -->|"Loads"| RP1
    SRC1 -->|"Builds"| BP1
    SRC1 -->|"Builds"| RP1
    TB1 -->|"Processes"| BP1
    TB1 -->|"Processes"| RP1
    G1 -.->|"Guides"| SRC1
    G1 -.->|"Guides"| TB1

    click BP1 "https://github.com/adr-hyng-oss/lumber-axe/tree/main/BP/functions"
    click BP2 "https://github.com/adr-hyng-oss/lumber-axe/tree/main/BP/items"
    click BP3 "https://github.com/adr-hyng-oss/lumber-axe/tree/main/BP/recipes"
    click BP4 "https://github.com/adr-hyng-oss/lumber-axe/tree/main/BP/entities"
    click BP5 "https://github.com/adr-hyng-oss/lumber-axe/tree/main/BP/scripts"

    click RP1 "https://github.com/adr-hyng-oss/lumber-axe/tree/main/RP/animation_controllers"
    click RP2 "https://github.com/adr-hyng-oss/lumber-axe/tree/main/RP/animations"
    click RP3 "https://github.com/adr-hyng-oss/lumber-axe/tree/main/RP/models"
    click RP4 "https://github.com/adr-hyng-oss/lumber-axe/tree/main/RP/textures"

    click SRC1 "https://github.com/adr-hyng-oss/lumber-axe/tree/main/src/classes"
    click SRC2 "https://github.com/adr-hyng-oss/lumber-axe/tree/main/src/commands"
    click SRC3 "https://github.com/adr-hyng-oss/lumber-axe/tree/main/src/configuration"
    click SRC4 "https://github.com/adr-hyng-oss/lumber-axe/tree/main/src/functions"
    click SRC5 "https://github.com/adr-hyng-oss/lumber-axe/tree/main/src/modules"
    click SRC6 "https://github.com/adr-hyng-oss/lumber-axe/tree/main/src/utils"

    click TB1 "https://github.com/adr-hyng-oss/lumber-axe/blob/main/tools/build.py"
    click TB2 "https://github.com/adr-hyng-oss/lumber-axe/blob/main/tools/process_config.py"
    click TB3 "https://github.com/adr-hyng-oss/lumber-axe/blob/main/tools/process_manifest.py"

    click G1 "https://github.com/adr-hyng-oss/lumber-axe/blob/main/guidelines/README.md"
    click G2 "https://github.com/adr-hyng-oss/lumber-axe/blob/main/guidelines/contribute.md"

    classDef runtime fill:#ADD8E6,stroke:#000,stroke-width:2px;
    classDef dev fill:#90EE90,stroke:#000,stroke-width:2px;
    classDef build fill:#FFA500,stroke:#000,stroke-width:2px;
    classDef docs fill:#D3D3D3,stroke:#000,stroke-width:2px;
```
