Skip to content

Commit

Permalink
Add opener settings to docs and update example crates config
Browse files Browse the repository at this point in the history
  • Loading branch information
WillBAnders committed Jun 7, 2022
1 parent 542e384 commit 966ecd6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
10 changes: 7 additions & 3 deletions docs/config/Crates.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Crates

Crates define everything necessary to open a crate, such as keys and rewards.
Crates define everything necessary to open a crate, such as keys, rewards, and
effects.

```java
<id> = {
Expand All @@ -9,6 +10,7 @@ Crates define everything necessary to open a crate, such as keys and rewards.
<key-reference>
...
]
opener = undefined/"gui"/"roulette"
effects = {
idle = [
<effect-reference>
Expand All @@ -25,12 +27,13 @@ Crates define everything necessary to open a crate, such as keys and rewards.
### Properties

| Name | Type | Description | Default |
| --- | --- | --- | --
| --- | --- | --- | --- |
| `name` | Text | The crate name, inherited from Component | This crate's capitalized `id` |
| `lore` | List<Text> | The crate lore, inherited from Component | An empty list |
| `icon` | Item | The crate icon, inherited from Component | A `chest` with the above `name`/`lore` |
| |
| `keys` | List<KeyReference> | The keys for this crate | An empty list |
| `opener` | undefined/`"gui"`/`"roulette"` | The opener for this crate | undefined (none) |
| `effects` | Map<Action, List<EffectReference | The effects for each action of this crate (`idle`/`open`/`give`/`reject`/`preview`) | An empty map |
| `rewards` | List<RewardReference> | The rewards for this crate | Required |

Expand All @@ -39,7 +42,7 @@ Crates define everything necessary to open a crate, such as keys and rewards.
<details>
<summary>Example</summary>

A crate containing the example key and rewards.
A crate containing the example key, rewards, and some effects.

```java
example = {
Expand All @@ -48,6 +51,7 @@ example = {
keys = [
["example", 1]
]
opener = "gui"
effects = {
idle = [
["rainbow-helix"]
Expand Down
9 changes: 9 additions & 0 deletions src/main/resources/assets/cratecrate/config/crates.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ example = {
keys = [
["example", 1]
]
opener = "gui"
effects = {
idle = [
["rainbow-helix"]
]
give = [
["green-creeper"]
]
}
rewards = [
["command-prizes", 50.0]
["item-prizes", 50.0]
Expand Down

0 comments on commit 966ecd6

Please sign in to comment.