Skip to content

Commit 00a2b8d

Browse files
committed
📦 More progress on unlock challenges
1 parent e49b78d commit 00a2b8d

File tree

9 files changed

+78
-10
lines changed

9 files changed

+78
-10
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Distribution
2+

docs/custom-backpack/setting-the-unlock-challenge/index.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

docs/custom-backpack/translations.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@ Every backpack has it's translation key created based on the **namespace** and t
4040

4141
## Next Step
4242

43-
It's time to [add a challenge](/docs/custom-backpack/setting-the-unlock-challenge/index.md) to unlock the backpack and give the player a fun goal!
43+
It's time to [add a challenge](/docs/custom-backpack/unlock-challenges/introduction.md) to unlock the backpack and give the player a fun goal!
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"label": "Unlock Challenges",
3+
"position": 7,
4+
"collapsible": true,
5+
"collapsed": false
6+
}

docs/custom-backpack/setting-the-unlock-challenge/challenge-types.mdx renamed to docs/custom-backpack/unlock-challenges/challenge-types.mdx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
---
2+
sidebar_position: 3
3+
---
4+
15
# Challenge Types
26

37
Backpacked comes with many built-in challenge types
@@ -69,7 +73,7 @@ Backpacked comes with many built-in challenge types
6973

7074
| Key | Type | Required | Default | Description |
7175
| -------------- | ------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
72-
| `crafted_item` | Object | No || A crafted item predicate object. If not defined or an empty object, any item will count towards the crafting goal. See [Crafted Item Predicate](/docs/custom-backpack/setting-the-unlock-challenge/predicates.mdx#crafted-item-predicate) for documentation and more examples. |
76+
| `crafted_item` | Object | No || A crafted item predicate object. If not defined or an empty object, any item will count towards the crafting goal. See [Crafted Item Predicate](/docs/custom-backpack/unlock-challenges/predicates.mdx#crafted-item) for documentation and more examples. |
7377
| `count` | Integer | No | 1 | The amount of items to craft in total |
7478

7579
#### Examples
@@ -194,7 +198,7 @@ Backpacked comes with many built-in challenge types
194198
| Key | Type | Required | Default | Description |
195199
| -------- | ------- | -------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
196200
| `block` | Object | No || An optinal blockstate predicate to test the interacting block. See [Minecraft Wiki](https://minecraft.wiki/w/Advancement/Conditions/entity) for more details. |
197-
| `item` | Object | No || An optional item predicate to test the held item of the interacting player. See [Minecraft Wiki](https://minecraft.wiki/w/Advancement/Conditions/entity) for more details. |
201+
| `item` | Object | No || An optional item predicate to test the held item of the interacting player. See [Minecraft Wiki](https://minecraft.wiki/w/Advancement/Conditions/item) for more details. |
198202
| `player` | Object | No || An optional entity predicate for the player. See [Minecraft Wiki](https://minecraft.wiki/w/Advancement/Conditions/entity) for more details. |
199203
| `count` | Integer | No | 1 | The amount of times to perform the action |
200204

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
sidebar_position: 2
3+
---
4+
5+
# Creating the Challenge
6+
7+
## Getting Started
8+
9+
Unlock challenge are defined in the same file used to [register the backpack](/docs/custom-backpack/register-the-backpack.md#registering). If you have not registered a backpack at this point, what the helly are you doing? Go back! Next you'll want to create a new object called `unlock_challenge` under the root object. This is where the unlock challenge will be defined, which includes an implementation of one of the [challenge types](/docs/custom-backpack/unlock-challenges/challenge-types.mdx), and setting the progress formatter.
10+
11+
The JSON should now look something similar to below:
12+
```json title="data/<namespace>/backpacked/<your_backpack_name>.json"
13+
{
14+
"unlock_challenge": {
15+
...
16+
}
17+
}
18+
```
19+
## Setting the Challenge
20+
21+
TODO
22+
23+
## Customise the Progress Formatter
24+
25+
A progress formatter controls how the unlock challenge displays the progression label. This label is shown in a tooltip when the player hovers a locked backpack in the customisation menu. For example, a formatter type that is available for use in addons is `backpacked:percentage`, and this will display a percentage based completion label. If the challenge is to mine ten diamond blocks, and currently only four have been mined, the tooltip will display as `Completed 40%`.
26+
27+
There are many progress formatters available to use, and it's best to select the one that fits the most appropriately to the challenge. Simply select one of the [available progress formatters](/docs/custom-backpack/unlock-challenges/formatter-types.mdx) and apply it to the unlock challenge as follows:
28+
29+
```json title="data/<namespace>/backpacked/<your_backpack_name>.json"
30+
{
31+
"unlock_challenge": {
32+
"formatter": "backpacked:percentage",
33+
...
34+
}
35+
}
36+
```
37+
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
sidebar_position: 4
3+
---
4+
5+
# Formatter Types
6+
7+
TODO
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
sidebar_position: 1
3+
---
4+
5+
# Introduction
6+
7+
Every backpack has the option to set an unlock challenge. Unlock challenges are simply goals the player can complete in order to unlock new backpacks. They are inspired from Advancements from the vanilla game, except the main difference is that the player unlocks a reward (the backpack).
8+
9+
Unlock challenges are persistent per save/server, they do not transfer to different saves/servers, just like Advancements. Partial completion of unlock challenges is also saved. This means that if the player has to cut down one-hundred oak logs, and they have only cut fifty, the unlock challenge will remember fifty oak logs have already been cut.
10+
11+
Backpacked comes equipped with the freedom to customise unlock challenge using one of the many available challenge types. All chellenge types have been designed to be highly customisable, allowing you to be creative as you want with your challenges. Kill ten zombies while holding a potato, you can do that! Travel one thousand blocks while driving a boat on land, sure, you can do that too!
12+
13+
## Next Step
14+
15+

docs/custom-backpack/setting-the-unlock-challenge/predicates.mdx renamed to docs/custom-backpack/unlock-challenges/predicates.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
---
2+
sidebar_position: 5
3+
---
4+
15
# Predicates
26

37
## List of Predicates

0 commit comments

Comments
 (0)