> For the complete documentation index, see [llms.txt](https://edseries-plugins.gitbook.io/p/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://edseries-plugins.gitbook.io/p/pinnaprison/tools-and-items/luckyblocks.md).

# Lucky Blocks

Lucky blocks are special items that a player **charges by mining**. Once a lucky block has had enough blocks mined while it's in the inventory, it can be right-clicked to redeem a random reward. They're obtained from the [Lucky Block ability](/p/pinnaprison/tools-and-items/abilities.md). Each tier is one file in `luckyblocks/<id>.yml`.

## Tiers

The default tiers are `common`, `rare` and `legendary` (the [Lucky Block ability](/p/pinnaprison/tools-and-items/abilities.md) decides which tier drops, by weight).

## Lucky block file

`luckyblocks/common.yml`:

```yaml
material: 'texture-…'           # the lucky block item (a custom head)
name: '&a&lCommon &2&lLucky Block'
required-blocks: 10000          # blocks to mine to charge it
glow-when-ready: true
lore:
  - '&7Mine blocks to charge this lucky block.'
  - '&aProgress: &f{blocks}&7/&c{required} &7blocks mined'
lore-ready:
  - '&7This lucky block is fully charged!'
  - '&a[ʀɪɢʜᴛ ᴄʟɪᴄᴋ ᴛᴏ ᴏᴘᴇɴ]'
redeem-message: '&aYou opened a {luckyblock} &aand won some loot!'
rewards:
  - 'give-eco money 250000'
  - 'give-eco tokens 50000'
  - 'message &a&l+ &fOpened a &2Common Lucky Block&f!'
```

| Key               | Description                                                                                                                       |
| ----------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| `material`        | The lucky block item (supports `texture-<base64>` heads).                                                                         |
| `name`            | Display name.                                                                                                                     |
| `required-blocks` | Blocks the player must mine (while it's in their inventory) to charge it.                                                         |
| `glow-when-ready` | Whether the item glows once fully charged.                                                                                        |
| `lore`            | Lore while charging. Placeholders: `{blocks}` (mined so far), `{required}`.                                                       |
| `lore-ready`      | Lore once fully charged.                                                                                                          |
| `redeem-message`  | Chat message on redeem (`{luckyblock}` = the block's name).                                                                       |
| `rewards`         | [Action lines](/p/pinnaprison/customization/item-format.md#actions) run when opened (`give-eco`, `message`, `console`, `player`). |

{% hint style="info" %}
All lucky blocks in the inventory charge **at the same time** as the player mines. The whole `rewards` list runs when one is opened — to make it random, use a console command to an external crate/loot plugin instead.
{% endhint %}

## Usage

* Obtain lucky blocks by equipping the **Lucky Block ability** and mining.
* **Right-click** a fully-charged lucky block to redeem it.
* **`/luckyblocks`** (alias `/luckyblock`) — base command.
* Admins: `/luckyblocks give <player> <luckyblock> [amount]`.


---

# 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://edseries-plugins.gitbook.io/p/pinnaprison/tools-and-items/luckyblocks.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.
