> 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/pinnablockselector/features/unlocking.md).

# Unlocking & Buying

A player has the Block Selector when any of these is true:

| Way            | How                                                                            | Kept               |
| -------------- | ------------------------------------------------------------------------------ | ------------------ |
| Bought in game | the purchase menu (`config.yml` → `purchase`)                                  | for good           |
| Given          | `blockselector give <player> [-s]` from the console or in game (works offline) | for good           |
| Rank           | the permission in `unlock-permission` (default `pinnablockselector.unlock`)    | while they have it |

## In-game purchase

```yaml
purchase:
  enabled: true
  currency: 'credits'   # any PinnaPrison currency id
  price: 2000
```

While it is locked, `/blockselector` and the `/mine` button open the purchase menu: the product, the price, the player's balance, and a confirm button (grey "Not Enough" look while they can't afford it). Buying takes the price, saves the payment and the unlock at once, plays the unlock sound and opens the selector. `enabled: false` turns the purchase off: locked players get the `locked` message instead.

If `purchase.currency` is not a PinnaPrison currency, the console warns at startup and on reload, and the purchase stays off until it is fixed.

## Store, crates, votes

Run `blockselector give {player} -s` from the console (`-s` = no chat message to the player). It works for offline players who joined before. `blockselector take <player>` removes it again.

## Rank permission

Players with `unlock-permission` have it while they keep the permission (checked live, and remembered from their last join so their mine is built with their blocks before permissions load). Their choice is kept if they lose the permission and comes back with it. `take` only removes a bought / given unlock: a player with the rank keeps it. Set `unlock-permission: ''` to turn this off.

## Where it is saved

`plugins/PinnaBlockSelector/data/players.yml`, or a MySQL table with `storage.type: mysql` ([Storage & MySQL](/p/pinnablockselector/getting-started/storage.md)): whether each player bought it, whether they had the rank at their last join, their name and their chosen blocks. It is written off the main thread, a moment after every change, and on shutdown.
