# chewawiii/epic-tombstones architecture

> Architecture diagram of the GitHub repository chewawiii/epic-tombstones, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/chewawiii/epic-tombstones
- Repository: https://github.com/chewawiii/epic-tombstones

## Overview

BetterTombs is a Minecraft Bedrock add-on that captures items and XP when a player dies, creates and protects a gravestone, then restores the contents when opened. Settings are available to players and operators; additional capabilities include intruder curses, death announcements, a Soul Pearl teleport item, and a tomb-distance HUD. The graph follows the documented and sampled runtime paths. Resource-pack assets and the item/block definitions are represented as content; unsampled wiring is not inferred.

Main entry points: [`EpicTombstones BP/scripts/TombUI.js`](https://github.com/chewawiii/epic-tombstones/blob/release/EpicTombstones%20BP/scripts/TombUI.js) (Settings menus), [`EpicTombstones BP/scripts/TombRecovery.js`](https://github.com/chewawiii/epic-tombstones/blob/release/EpicTombstones%20BP/scripts/TombRecovery.js) (Tomb recovery), [`EpicTombstones BP/scripts/TombManager.js`](https://github.com/chewawiii/epic-tombstones/blob/release/EpicTombstones%20BP/scripts/TombManager.js) (Tomb manager), [`EpicTombstones BP/scripts/TombCreation.js`](https://github.com/chewawiii/epic-tombstones/blob/release/EpicTombstones%20BP/scripts/TombCreation.js) (Death capture)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_lifecycle["Tomb lifecycle"]
  node_death["Death capture<br/>[TombCreation.js]"]
  node_manager["Tomb manager<br/>[TombManager.js]"]
  node_worldstate[("World dynamic properties")]
end

subgraph group_access["Recovery and access"]
  node_recovery["Tomb recovery<br/>[TombRecovery.js]"]
  node_hudpearl["HUD and Soul Pearl<br/>[TombUtils.js]"]
end

subgraph group_settings["Settings and status"]
  node_settingsui["Settings menus<br/>[TombUI.js]"]
  node_config["Configuration defaults<br/>[TombConfig.js]"]
  node_translation["Translation helper<br/>[TombIndex.js]"]
end

subgraph group_content["Pack content"]
  node_blockdefs["Tombstone blocks"]
  node_pearlitem["Soul Pearl item<br/>[soul_pearl.json]"]
  node_resourcepack["Models and textures"]
  node_locales["English and Spanish text"]
end

node_player(("Player"))

node_player -->|"dies"| node_death
node_death -->|"registers tomb"| node_manager
node_manager -->|"stores tomb data"| node_worldstate
node_player -->|"opens tomb"| node_recovery
node_recovery -->|"deletes tomb"| node_manager
node_recovery -->|"reads tomb data"| node_worldstate
node_player -->|"opens settings"| node_settingsui
node_settingsui -->|"loads player config"| node_manager
node_settingsui -->|"saves settings"| node_worldstate
node_manager -->|"uses defaults"| node_config
node_death -->|"uses item rates"| node_config
node_recovery -->|"uses curse levels"| node_config
node_settingsui -->|"opens managed tomb"| node_recovery
node_player -->|"uses teleport item"| node_hudpearl
node_hudpearl -->|"reads player config"| node_manager
node_death -->|"formats announcements"| node_translation
node_recovery -->|"formats messages"| node_translation
node_settingsui -->|"translates form"| node_translation
node_death -.->|"places tombstone"| node_blockdefs
node_pearlitem -.->|"registers component"| node_hudpearl
node_resourcepack -.->|"provides block models"| node_blockdefs
node_settingsui -.->|"uses translation keys"| node_locales

click node_death "https://github.com/chewawiii/epic-tombstones/blob/release/EpicTombstones%20BP/scripts/TombCreation.js"
click node_manager "https://github.com/chewawiii/epic-tombstones/blob/release/EpicTombstones%20BP/scripts/TombManager.js"
click node_recovery "https://github.com/chewawiii/epic-tombstones/blob/release/EpicTombstones%20BP/scripts/TombRecovery.js"
click node_settingsui "https://github.com/chewawiii/epic-tombstones/blob/release/EpicTombstones%20BP/scripts/TombUI.js"
click node_config "https://github.com/chewawiii/epic-tombstones/blob/release/EpicTombstones%20BP/scripts/TombConfig.js"
click node_hudpearl "https://github.com/chewawiii/epic-tombstones/blob/release/EpicTombstones%20BP/scripts/TombUtils.js"
click node_translation "https://github.com/chewawiii/epic-tombstones/blob/release/EpicTombstones%20BP/scripts/TombIndex.js"
click node_blockdefs "https://github.com/chewawiii/epic-tombstones/tree/release/EpicTombstones%20BP/blocks"
click node_pearlitem "https://github.com/chewawiii/epic-tombstones/blob/release/EpicTombstones%20BP/items/soul_pearl.json"
click node_resourcepack "https://github.com/chewawiii/epic-tombstones/tree/release/EpicTombstones%20RP"
click node_locales "https://github.com/chewawiii/epic-tombstones/tree/release/EpicTombstones%20RP/texts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_death,node_manager,node_worldstate toneBlue
class node_recovery,node_hudpearl toneAmber
class node_settingsui,node_config,node_translation toneMint
class node_blockdefs,node_pearlitem,node_resourcepack,node_locales toneRose
class node_player toneIndigo
```

## Components

### Tomb lifecycle

- [Death capture](https://github.com/chewawiii/epic-tombstones/blob/release/EpicTombstones%20BP/scripts/TombCreation.js): `EpicTombstones BP/scripts/TombCreation.js`
- [Tomb manager](https://github.com/chewawiii/epic-tombstones/blob/release/EpicTombstones%20BP/scripts/TombManager.js): `EpicTombstones BP/scripts/TombManager.js`
- **World dynamic properties**

### Recovery and access

- [Tomb recovery](https://github.com/chewawiii/epic-tombstones/blob/release/EpicTombstones%20BP/scripts/TombRecovery.js): `EpicTombstones BP/scripts/TombRecovery.js`
- [HUD and Soul Pearl](https://github.com/chewawiii/epic-tombstones/blob/release/EpicTombstones%20BP/scripts/TombUtils.js): `EpicTombstones BP/scripts/TombUtils.js`

### Settings and status

- [Settings menus](https://github.com/chewawiii/epic-tombstones/blob/release/EpicTombstones%20BP/scripts/TombUI.js): `EpicTombstones BP/scripts/TombUI.js`
- [Configuration defaults](https://github.com/chewawiii/epic-tombstones/blob/release/EpicTombstones%20BP/scripts/TombConfig.js): `EpicTombstones BP/scripts/TombConfig.js`
- [Translation helper](https://github.com/chewawiii/epic-tombstones/blob/release/EpicTombstones%20BP/scripts/TombIndex.js): `EpicTombstones BP/scripts/TombIndex.js`

### Pack content

- [Tombstone blocks](https://github.com/chewawiii/epic-tombstones/tree/release/EpicTombstones%20BP/blocks): `EpicTombstones BP/blocks`
- [Soul Pearl item](https://github.com/chewawiii/epic-tombstones/blob/release/EpicTombstones%20BP/items/soul_pearl.json): `EpicTombstones BP/items/soul_pearl.json`
- [Models and textures](https://github.com/chewawiii/epic-tombstones/tree/release/EpicTombstones%20RP): `EpicTombstones RP`
- [English and Spanish text](https://github.com/chewawiii/epic-tombstones/tree/release/EpicTombstones%20RP/texts): `EpicTombstones RP/texts`

### Other components

- **Player**

## Connections

- Player → Death capture: dies (evidence: `EpicTombstones BP/scripts/TombCreation.js`)
- Death capture → Tomb manager: registers tomb (evidence: `EpicTombstones BP/scripts/TombCreation.js`)
- Tomb manager → World dynamic properties: stores tomb data (evidence: `EpicTombstones BP/scripts/TombManager.js`)
- Player → Tomb recovery: opens tomb (evidence: `EpicTombstones BP/scripts/TombRecovery.js`)
- Tomb recovery → Tomb manager: deletes tomb (evidence: `EpicTombstones BP/scripts/TombRecovery.js`)
- Tomb recovery → World dynamic properties: reads tomb data (evidence: `EpicTombstones BP/scripts/TombRecovery.js`)
- Player → Settings menus: opens settings (evidence: `EpicTombstones BP/scripts/TombUI.js`)
- Settings menus → Tomb manager: loads player config (evidence: `EpicTombstones BP/scripts/TombUI.js`)
- Settings menus → World dynamic properties: saves settings (evidence: `EpicTombstones BP/scripts/TombUI.js`)
- Tomb manager → Configuration defaults: uses defaults (evidence: `EpicTombstones BP/scripts/TombManager.js`)
- Death capture → Configuration defaults: uses item rates (evidence: `EpicTombstones BP/scripts/TombCreation.js`)
- Tomb recovery → Configuration defaults: uses curse levels (evidence: `EpicTombstones BP/scripts/TombRecovery.js`)
- Settings menus → Tomb recovery: opens managed tomb (evidence: `EpicTombstones BP/scripts/TombUI.js`)
- Player → HUD and Soul Pearl: uses teleport item (evidence: `EpicTombstones BP/scripts/TombUtils.js`)
- HUD and Soul Pearl → Tomb manager: reads player config (evidence: `EpicTombstones BP/scripts/TombUtils.js`)
- Death capture → Translation helper: formats announcements (evidence: `EpicTombstones BP/scripts/TombCreation.js`)
- Tomb recovery → Translation helper: formats messages (evidence: `EpicTombstones BP/scripts/TombRecovery.js`)
- Settings menus → Translation helper: translates form (evidence: `EpicTombstones BP/scripts/TombUI.js`)
- Death capture → Tombstone blocks: places tombstone
- Soul Pearl item → HUD and Soul Pearl: registers component
- Models and textures → Tombstone blocks: provides block models
- Settings menus → English and Spanish text: uses translation keys
