Skip to content

Commit

Permalink
Update macros.md
Browse files Browse the repository at this point in the history
  • Loading branch information
AngryBeaver authored Sep 12, 2023
1 parent 2c43ca1 commit 88dea3d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions macros.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,15 +139,15 @@ Similar to update this will delete all appearance of that component in the craft
### Selectively keep ingredients on failed crafting
with this code your crafting will not consume the first ingredient component when crafting fails.
````javascript
const ingredient1 = Object.values(recipeData.ingredients)[0];
const ingredient1 = Object.values(recipeData.input)[0];
result.updateComponent("consumed",ingredient1,
(componentResult, quantity) => {
componentResult.userInteraction = "onSuccess"
});
````
or the other way it will explicitly consume the first ingredient component also on failed crafting checks.
````javascript
const ingredient1 = Object.values(recipeData.ingredients)[0];
const ingredient1 = Object.values(recipeData.input)[0];
result.updateComponent("consumed",ingredient1,
(componentResult, quantity) => {
componentResult.userInteraction = "always"
Expand Down

0 comments on commit 88dea3d

Please sign in to comment.