# Month goal

The month goal shows on the store home page how much the community has bought and
how much is left to reach an amount, with rewards at each milestone. It is a way
to turn sales into an event: "at R$ 5,000, there is a new BedWars map".

Everything is in **Store > Month Goal**.

![The Month Goal screen: amount, dates and rewards with the in-game reward](shots/products-goal.webp)

## Create the goal

1. In **Store > Month Goal**, turn on **Enable Monthly Goal**.
2. Enter the **Goal Target Amount**, the **Start Date** and the **End Date**.
3. In **Rewards**, click **Add Reward** for each milestone. Each one has the
   **Reward Description** and the **Required Amount**.
4. Save. The preview, on the same screen, shows how the goal looks in the store.

The collected amount adds up on its own from confirmed orders (paid, processing,
shipped or delivered) from the start date on.

## In-game reward

In Minecraft and Hytale stores (plugin 2.7.0 or newer), each milestone can have
an in-game reward for when the store passes it:

- **Who receives it**: **Who is online on the server** (whoever is playing at
  that moment) or **Everyone on the server, even offline** (whoever is offline
  gets it when they join, up to 30 days later; only those who had played before
  the milestone; on Hytale, only those online).
- **For each player who receives it**: one command per line, without the slash,
  with `{player}` where the nick goes.
- **Once on the console**: commands without a player, which run once on each
  server.

```text For each player who receives it
give {player} diamond 5
eco give {player} 500
```

```text Once on the console
say The goal was reached! Thank you, community!
```

When the store passes the milestone, the chat tells everyone and the commands run
only once per goal; refunds and editing the goal do not repeat them. Up to 20
commands in each box, up to 500 characters each.

> [!NOTE]
> A milestone the store had already passed when the commands were saved is marked
> as reached, and its commands do not run. Editing the commands needs the plugin
> settings permission.

## The goal on the game screen

On the in-game goal card (plugin 2.5.0 or newer), with each purchase that moves
the goal, the top bar and the bottom bar of the screen show how much is left:
only when someone buys (for the time you pick, from 3 to 300 seconds) or fixed on
screen all the time. Pick both, just one or none, the color and the bar design.

The same design applies to the PlaceholderAPI placeholders:
`%hystore_meta_barra%`, `%hystore_meta%`, `%hystore_meta_atual%`,
`%hystore_meta_alvo%` and `%hystore_meta_falta%`.

> [!TIP]
> Goals that work have rewards for everyone, not only buyers: a double XP event,
> a kit for the whole server, a new map. That way those who do not buy also cheer,
> and spread the word.
