> For the complete documentation index, see [llms.txt](https://arckytech.gitbook.io/arckys-poke-mart-guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://arckytech.gitbook.io/arckys-poke-mart-guide/settings-and-setup-file/badges-for-items.md).

# Badges for Items

How to Limit an Item to a certain amount of Badges.

By default in Essentials you would need to setup a list of items for each badge amount that you want to change the items available for.&#x20;

<div align="left"><figure><img src="https://1523864583-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FA8k6OdYm2B0bVeFyJUcK%2Fuploads%2Fr6xdDfAuHBMJ0R2TrONh%2FDefault%20Mart%20Script%20for%20Badges.png?alt=media&amp;token=efad0cb2-2682-434a-b19b-eff585802a7c" alt="" width="337"><figcaption><p>Default Mart Event for Badges</p></figcaption></figure></div>

This plugin provides a handy Setting that handles this for you.

```ruby
BADGES_FOR_ITEMS = {
  1 => [:GREATBALL, :SUPERPOTION, :ANTIDOTE, :PARALYZEHEAL, :AWAKENING, :BURNHEAL, :ICEHEAL, :REPEL, :ESCAPEROPE],
  3 => [:HYPERPOTION, :SUPERREPEL, :REVIVE],
  5 => [:ULTRABALL, :FULLHEAL, :MAXREPEL],
  7 => [:MAXPOTION],
  8 => [:FULLRESTORE]
}
```

Simply said, you add the badge amount and assign an array of items that will be available when you have at least this amount of badges. This Setting is similar at how you setup the HM's usage in the Overworld for each badge. But the difference there is that you can do this by a specific badge (by ID) or the amount.

Any Items that are not mentioned in the BADGES\_FOR\_ITEMS Setting will be buyable from the start.

```ruby
def pbSomeMart
  pbPokemonMart([
    :POKEBALL, :GREATBALL, :ULTRABALL,
    :POTION, :SUPERPOTION, :HYPERPOTION, :MAXPOTION,
    :FULLRESTORE, :REVIVE,
    :ANTIDOTE, :PARALYZEHEAL, :AWAKENING, :BURNHEAL, :ICEHEAL,
    :FULLHEAL,
    :REPEL, :SUPERREPEL, :MAXREPEL
  ], useCat: true)
end
```

So if we made this method and added this at the bottom of the 000\_PokeMarket\_Settings\_and\_Setup.rb file, we only need to a script command in the event saying pbSomeMart.

<div align="left"><figure><img src="https://1523864583-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FA8k6OdYm2B0bVeFyJUcK%2Fuploads%2F2FsevMuUA5y6QbT42ssa%2FShorter%20Mart%20Event%20for%20Badges.png?alt=media&amp;token=c6fdb6a7-5379-4da1-b9cf-547c6fce227c" alt="" width="337"><figcaption><p>Shorter Mart Event for Badges</p></figcaption></figure></div>

Result in Game when we have 0 Badges:

<div align="left"><figure><img src="https://1523864583-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FA8k6OdYm2B0bVeFyJUcK%2Fuploads%2FjwVrdlTLIK0VsyurjBxR%2F0%20Badges%20Item%20Category%201.png?alt=media&amp;token=45ad064a-7864-4108-afcb-88c66bd358b5" alt="" width="375"><figcaption><p>No Badges Item Category 1</p></figcaption></figure></div>

<div align="left"><figure><img src="https://1523864583-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FA8k6OdYm2B0bVeFyJUcK%2Fuploads%2FA69yf4PY73gVo44GPArA%2F0%20Badges%20Item%20Category%202.png?alt=media&amp;token=6248574b-bb28-4616-b657-1b18a5423df8" alt="" width="375"><figcaption><p>No Badges Item Category 2</p></figcaption></figure></div>

Result in Game when we have 1 Badge:

<div align="left"><figure><img src="https://1523864583-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FA8k6OdYm2B0bVeFyJUcK%2Fuploads%2F6tiDgszhnGDSy4Fa45uV%2F1%20Badge%20Item%20Category%201.png?alt=media&amp;token=40963054-a79b-49a1-a6bc-b4babfb19b36" alt="" width="375"><figcaption><p>1 Badge Item Category 1</p></figcaption></figure></div>

<div align="left"><figure><img src="https://1523864583-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FA8k6OdYm2B0bVeFyJUcK%2Fuploads%2FeLRYISx2i9PcgBKYvvqV%2F1%20Badge%20Item%20Category%202.png?alt=media&amp;token=dc6edbe9-2040-492d-a22f-1c33e779347b" alt="" width="375"><figcaption><p>1 Badge Item Category 2</p></figcaption></figure></div>

<div align="left"><figure><img src="https://1523864583-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FA8k6OdYm2B0bVeFyJUcK%2Fuploads%2FqPLtv3DazuLppye3P0yP%2F1%20Badge%20Item%20Category%203.png?alt=media&amp;token=64180e69-d5a9-4677-a9cd-de82604ff232" alt="" width="375"><figcaption><p>1 Badge Item Category 3</p></figcaption></figure></div>

<div align="left"><figure><img src="https://1523864583-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FA8k6OdYm2B0bVeFyJUcK%2Fuploads%2FWiZdHuCiGJYhIAVRXnbr%2F1%20Badge%20Item%20Category%204.png?alt=media&amp;token=61195a19-7208-40d7-98ac-869576570c43" alt="" width="375"><figcaption><p>1 Badge Item Category 4</p></figcaption></figure></div>

And we can keep going for when we have 3 badges but looking at the`BADGES_FOR_ITEMS`Setting, it'll add the`:HYPERPOTION`, `:SUPERREPEL` and `:REVIVE` items to the buyable items.
