> For the complete documentation index, see [llms.txt](https://star-generator.gitbook.io/star-generator-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://star-generator.gitbook.io/star-generator-docs/features/energy-system.md).

# energy system

Energy is configured per table under `energySetting`.

If `energySetting.useEnergy` is `false`, the table does not require energy.

## Example

```yaml
energySetting:
  useEnergy: true
  maxEnergy: 80
  energyBase: 1
  consume: "START_CRAFTING"
  replenish: "FULLY"
  energySlot: [43]
  energy_progress_slot: [38]
  energyItem:
    Powder_Snow_Bucket:
      type: "minecraft:powder_snow_bucket:0"
      amount: 1
      energy: 10
      name: "Powder Snow Bucket"
  energy_progress:
    0: "itemsadder:starter_icecream:ui_energy_progress_0"
    25: "itemsadder:starter_icecream:ui_energy_progress_25"
    50: "itemsadder:starter_icecream:ui_energy_progress_50"
    75: "itemsadder:starter_icecream:ui_energy_progress_75"
    100: "itemsadder:starter_icecream:ui_energy_progress_100"
  energy-progress-detail:
    name: "&bStored Energy"
    lore:
      - "&7Stored: &f%current_energy%/%max_energy%"
      - "&7Charge: &f%energy_percent%%"
```

## Fields

| Field                    | Description                                                  |
| ------------------------ | ------------------------------------------------------------ |
| `useEnergy`              | Enables or disables the energy system for this table.        |
| `maxEnergy`              | Maximum stored energy.                                       |
| `energyBase`             | Base energy drain used by supported consume modes.           |
| `consume`                | When crafting consumes energy.                               |
| `replenish`              | How energy is replenished.                                   |
| `energySlot`             | Main GUI slots where fuel items can be placed.               |
| `energy_progress_slot`   | Main GUI slot used to show the energy progress item.         |
| `energyItem`             | Valid fuel or battery items.                                 |
| `energy_progress`        | Percent-to-item map for the energy bar.                      |
| `energy-progress-detail` | Shared display name and lore for every energy progress item. |

## Consume Modes

| Mode             | Meaning                                    |
| ---------------- | ------------------------------------------ |
| `PER_SECONDS`    | Consumes energy repeatedly while crafting. |
| `START_CRAFTING` | Consumes energy when crafting starts.      |
| `END_CRAFTING`   | Consumes energy when crafting finishes.    |
| `EVERYTIME`      | Uses the table's recurring energy logic.   |

## Replenish Modes

| Mode          | Meaning                                                  |
| ------------- | -------------------------------------------------------- |
| `ON_CRAFTING` | Fuel is processed through the crafting interaction flow. |
| `FULLY`       | Fuel fills stored energy in a battery-style flow.        |
| `AFTER_CLICK` | Uses configured click buttons to replenish energy.       |

## `FULLY` Behavior

`FULLY` runs as an automatic refill flow:

* If stored energy reaches `0`, the table consumes valid energy items one at a time until full.
* If a recipe is selected or matched and stored energy is below that recipe's adjusted energy cost, the refill starts even if energy is not exactly `0`.
* If stored energy is still enough for the selected recipe, it does not repeatedly consume fuel just because the player clicked the GUI.
* When the table reaches full energy, the refill stops until the next low-energy trigger.

## `AFTER_CLICK` Buttons

Tables can define click buttons for manual charge behavior:

```yaml
energySetting:
  replenish: "AFTER_CLICK"
  AFTER_CLICK_Button:
    one:
      slot: [40]
      name: "&aCharge"
      type: "minecraft:lime_stained_glass_pane:0"
```

Keep these button slots separate from craft input, output, progress, and energy slots.

## Energy Progress Items

The percent keys are thresholds. StarGenerator chooses the progress item that best matches the current stored energy percentage.

Common starter icons:

```yaml
0: "itemsadder:starter_icecream:ui_energy_progress_0"
25: "itemsadder:starter_icecream:ui_energy_progress_25"
50: "itemsadder:starter_icecream:ui_energy_progress_50"
75: "itemsadder:starter_icecream:ui_energy_progress_75"
100: "itemsadder:starter_icecream:ui_energy_progress_100"
```

Energy progress tooltips are visible by default. Use `energy-progress-detail.name` and `energy-progress-detail.lore` to set one shared tooltip for all progress items.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://star-generator.gitbook.io/star-generator-docs/features/energy-system.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
