-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Rewrite and add consumables Building on top of #90 Signed-off-by: TheRealPear <20259871+TheRealPear@users.noreply.github.com> Co-Authored-By: Half <41559602+OhPointFive@users.noreply.github.com> * Merge kit attribute into action attribute Signed-off-by: TheRealPear <20259871+TheRealPear@users.noreply.github.com> --------- Signed-off-by: TheRealPear <20259871+TheRealPear@users.noreply.github.com> Co-authored-by: Half <41559602+OhPointFive@users.noreply.github.com>
- Loading branch information
1 parent
2783b68
commit bbd9101
Showing
3 changed files
with
69 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
--- | ||
id: consumables | ||
title: Consumables | ||
--- | ||
|
||
Consumables are items that can be made "edible" to the player and "consuming" it will allow them to run an action or receive a kit. | ||
It can be defined and applied to items in [kits](/docs/modules/gear/kits). | ||
When consumed, these items can trigger [actions](/docs/modules/mechanics/actions-triggers), and override vanilla eating or drinking behavior. | ||
|
||
#### Consumables Element | ||
|
||
<div className="table-container"> | ||
| Element | Description | | ||
|---|---| | ||
| `<consumables> </consumables>` | Node containing the consumables definitions. | | ||
|
||
| Sub-elements || | ||
|---|---| | ||
| `<consumable> </consumable>` | An individual consumable. | | ||
</div> | ||
|
||
#### Consumable Attributes | ||
|
||
<div className="table-container"> | ||
| Attribute | Description | Value | Default | | ||
|---|---|---|---| | ||
| `id` | <span className="badge badge--danger">Required</span>Unique identifier used to reference this consumable from other places in the XML. | <span className="badge badge--primary">String</span> | | ||
| `action`|`kit` | <span className="badge badge--danger">Required</span>Run the specified action upon consumption. | [Action ID](/docs/modules/mechanics/actions-triggers) | | ||
| `on` | <span className="badge badge--danger">Required</span>Specify how the consumable should be used.<br />**Note:** The only action currently supported is `eat`. In the future, more actions such as clicking will be supported. | `eat` | | ||
| `override` | Consumable is affected by vanilla behaviors, such as giving the player potion effects.<br />*This is useful when using potion bottles and golden apples as the consumable item.* | <span className="badge badge--primary">true/false</span> | true | | ||
</div> | ||
|
||
### Examples | ||
|
||
```xml | ||
<!-- Create the consumable "template" --> | ||
<consumables> | ||
<consumable id="porkchop-that-says-yum" action="say-yum" on="eat" override="false"/> | ||
</consumables> | ||
<!-- Apply the consumable to an item --> | ||
<kits> | ||
<kit id="spawn"> | ||
<item slot="1" amount="5" consumable="porkchop-that-says-yum" material="pork"/> | ||
</kit> | ||
</kits> | ||
<!-- Define the action the consumable will run --> | ||
<actions> | ||
<message id="say-yum" text="Yum!"/> | ||
</actions> | ||
``` | ||
|
||
```xml | ||
<!-- Create the consumable "template" --> | ||
<consumables> | ||
<consumable id="fast-apple" kit="speed-kit" on="eat"/> | ||
</consumables> | ||
<kits> | ||
<!-- Apply the consumable to an item --> | ||
<kit id="spawn"> | ||
<item slot="1" consumable="fast-apple" name="Fast Apple" material="golden apple"/> | ||
</kit> | ||
<!-- Define the kit the consumable gives you --> | ||
<kit id="speed-kit"> | ||
<effect duration="4" amplifier="10">speed</effect> | ||
</kit> | ||
</kits> | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters