# How to setup an event

## Event Types

There currently are 3 event types.

#### `SPENT_AMOUNT`&#x20;

As the name suggests, this event tracks a players spending no matter what.\
This is the type used for the Patron Event Example.

#### `SPENT_AMOUNT_ON_PACKAGE`

This event tracks amounts spent on certain packages.

#### `PACKAGE_PURCHASE_COUNT`

This event tracks the amount certain packages were purchased.\
This is the type used for the King Crate Key Example.

## Configuration Sections

#### Condition

{% code title="" overflow="wrap" lineNumbers="true" expandable="true" %}

```yaml
condition:
  type: SPENT_AMOUNT     # Here you define the event type, see above for the options.
  delay: 100             # This delay in ticks (20 ~ 1s)
  amount: 1500.0         # This is the value representation, meaning depends on the event type
  packages:              # This section is only needed for PACKAGE_PURCHASE_COUNT
        244071922: 1     # It contains the package ids and their weight.      
        -1344275980: 3
  packages:              # This section is only needed for SPENT_AMOUNT_ON_PACKAGE
  - 2311231              # It just contains the package ids.
  - 3123213
```

{% endcode %}

#### Repeat

{% code title="" overflow="wrap" lineNumbers="true" expandable="true" %}

```yml
repeat:
  enabled: false          # Toggles the event to be repeatable or not.
```

{% endcode %}

#### Reward

{% code title="" overflow="wrap" lineNumbers="true" expandable="true" %}

```yml
reward:
  commands:
  - eco add %player% 10000
```

{% endcode %}

#### Time

{% code title="" overflow="wrap" lineNumbers="true" expandable="true" %}

```yml
time:
  enabled: true
  start: '2026-02-01T00:00:00Z'
  end: '2028-02-15T23:59:59Z'
```

{% endcode %}

#### Message

{% code title="" overflow="wrap" lineNumbers="true" expandable="true" %}

```yaml
message:             # If not specified, the default messages from messages.yml are used.
  progress: []       # Placeholders you can use for theese: 
  completed: []      # %progress_bar%, %name%, %percentage%, %progress%, %goal%, %remaining%
```

{% endcode %}

#### Progress-Bar

{% code title="" overflow="wrap" lineNumbers="true" expandable="true" %}

```yml
progress-bar:           # If not specified the default from config.yml is used
  percentage: 10.0      # the percentage a single bar represents - double from 1 to 100
  display-mode: gradient # you can choose between SOLID and GRADIENT
    full: █              # the bar that is reached
    empty: '&f█'        # the bar that is not reached yet
    gradient: '#ff0080:#00ff00:#0000ff:#ff80ff' # separate the two hex codes with a :
```

{% endcode %}

## Patron Event Example

This example shows a spending event rewarding the Patron Rank.

{% code title="" overflow="wrap" lineNumbers="true" expandable="true" %}

```yaml
patron:
    enabled: true
    display-name: '&#ff0080&lP&#669933&lA&#00cc33&lT&#0033cc&lR&#6633ff&lO&#ff80ff&lN &f&lRANK'
    condition:
      type: SPENT_AMOUNT
      delay: 100
      amount: 1500.0
    repeat:
      enabled: false
    reward:
      commands:
      - lp user %player% parent add %player% patron
    time:
      start: '2026-02-01T00:00:00Z'
      end: '2028-02-15T23:59:59Z'
      enabled: true
    message:
      progress: []
      completed:
      - ''
      - '                          #ffe44a&l⭐ &f%name% #ffe44a&l⭐'
      - ''
      - '   &fYou have Spent &#ff0080&l$&#669933&l1&#00cc33&l,&#0033cc&l5&#6633ff&l0&#ff80ff&l0&f and unlocked the &#ff0080&lP&#669933&lA&#00cc33&lT&#0033cc&lR&#6633ff&lO&#ff80ff&lN &fRank.'
      - '               &fThank you for your continious support.'
      - ''
    progress-bar:
      percentage: 10.0 # the percentage a single bar represents - double from 1 to 100
      display-mode: gradient # you can choose between solid and gradient
      full: █ # the bar that is reached
      empty: '&f█' # the bar that is not reached yet
      gradient: '#ff0080:#00ff00:#0000ff:#ff80ff' # separate the two hex codes with a :
```

{% endcode %}

## King Crate Key Example

This example rewards the player 2 extra king crate keys with every 15 purchased keys.


---

# Agent Instructions: 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://obey.gitbook.io/wiki/storeevents/how-to-setup-an-event.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.
