Skip to content

Commit 1be7641

Browse files
committed
📦 Finish travel distance challenge docs
1 parent f38a7ee commit 1be7641

1 file changed

Lines changed: 58 additions & 11 deletions

File tree

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

Lines changed: 58 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -444,11 +444,11 @@ Backpacked comes with many built-in challenge types
444444

445445
**Description:** A challenge that requires the player to trade with a merchant type entity. Supports Villagers, Wandering Traders, and even modded NPCs like Goblin Traders.
446446

447-
| Key | Type | Required | Default | Description |
448-
| -------- | ------- | -------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
449-
| `block` | Object | No || An optional block snapshot predicate to test to against the block that was just mined. See Block Snapshot Predicate for more details. |
450-
| `item` | Object | No || An optional item predicate to test the item that was used by the player to mine the block. See [Minecraft Wiki](https://minecraft.wiki/w/Advancement/Conditions/item) for more details. |
451-
| `player` | Object | No || An optional entity predicate for the player. See [Minecraft Wiki](https://minecraft.wiki/w/Advancement/Conditions/entity) for more details. |
447+
| Key | Type | Required | Default | Description |
448+
| -------- | ------ | -------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
449+
| `block` | Object | No || An optional block snapshot predicate to test to against the block that was just mined. See Block Snapshot Predicate for more details. |
450+
| `item` | Object | No || An optional item predicate to test the item that was used by the player to mine the block. See [Minecraft Wiki](https://minecraft.wiki/w/Advancement/Conditions/item) for more details. |
451+
| `player` | Object | No || An optional entity predicate for the player. See [Minecraft Wiki](https://minecraft.wiki/w/Advancement/Conditions/entity) for more details. |
452452
| `count` | Number | No | 1 | The amount of times the `player` has to mine the `block` |
453453

454454
#### Examples
@@ -459,13 +459,60 @@ TODO
459459

460460
**ID:** `backpacked:travel_distance`
461461

462-
**Description:** A challenge that requires the player to trade with a merchant type entity. Supports Villagers, Wandering Traders, and even modded NPCs like Goblin Traders.
462+
**Description:** A challenge that requires the player to travel a specific
463+
464+
| Key | Type | Required | Default | Description |
465+
| ---------------- | ------ | -------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
466+
| `movement` | String | No || The type of movement. If left undefined, any type of movement will count towards the `total distance`. Available list of movements are: `walk`, `sprint`, `sneak`, `swim`, `walk_underwater`, `walk_on_water`, `climb`, `elytra_flying`, `fly`, and `fall`. |
467+
| `total_distance` | Number | Yes || The total distance (in centimetres) the player must move while in the correct `movement` type. The number must be positive. |
468+
| `player` | Object | No || An optional entity predicate for the player. See [Minecraft Wiki](https://minecraft.wiki/w/Advancement/Conditions/entity) for more details. **Important:** Keep it simple since this check is run often. |
463469

464-
| Key | Type | Required | Default | Description |
465-
| ---------------- | ------ | -------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
466-
| `movement` | String | No || The type of movement. See list below of valid movement types. If left undefined, any type of movement will count towards the `total distance`. |
467-
| `total_distance` | Number | Yes || The total distance the player must move while in the correct `movement` type. The number must be positive. |
470+
:::note
471+
The `total_distance` is calculated in centimetres. To travel one block is the equivalent of 100 centimetres.
472+
:::
468473

469474
#### Examples
470475

471-
TODO
476+
<div class="code-block">
477+
**Sprint a total of 100km (62.1 miles) to unlock this backpack**
478+
479+
```json title="data/<namespace>/backpacked/<your_backpack>.json"
480+
{
481+
"unlock_challenge": {
482+
"formatter": "backpacked:travelled_blocks",
483+
"challenge": {
484+
"type": "backpacked:travel_distance",
485+
"movement": "sprint",
486+
"total_distance": 10000000
487+
}
488+
}
489+
}
490+
```
491+
</div>
492+
493+
<div class="code-block">
494+
**Travel 100 blocks while riding on a Boat on land to unlock this backpack**
495+
496+
```json title="data/<namespace>/backpacked/<your_backpack>.json"
497+
{
498+
"unlock_challenge": {
499+
"formatter": "backpacked:travelled_blocks",
500+
"challenge": {
501+
"type": "backpacked:travel_distance",
502+
"movement": "vehicle",
503+
"total_distance": 10000,
504+
"player": {
505+
"vehicle": {
506+
"type": [
507+
"minecraft:boat"
508+
],
509+
"flags": {
510+
"is_on_ground": true
511+
}
512+
}
513+
}
514+
}
515+
}
516+
}
517+
```
518+
</div>

0 commit comments

Comments
 (0)