-
Notifications
You must be signed in to change notification settings - Fork 4
update docs #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
edayot
wants to merge
9
commits into
main
Choose a base branch
from
upstream/update_crafter_docs
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
update docs #19
Changes from 1 commit
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
df723f7
docs: update colon with code-block :force:
edayot f438db8
Merge branch 'Smithed-MC:main' into main
edayot e143a6f
update to 1.20.5 item format & fix shapeless recipes
edayot 2fe6976
update docs
edayot 527a247
Apply suggestions from code review
edayot a6010be
Apply suggestion from @edayot
edayot 404d174
Merge branch 'main' into upstream/update_crafter_docs
edayot 867d3fb
Merge branch 'main' into upstream/update_crafter_docs
edayot 0ab0c11
Merge commit '963dab5' into upstream/update_crafter_docs
edayot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,61 @@ | ||||||
| # Advanced remove (flags) | ||||||
|
|
||||||
| Flags customize the way items are removed in the input while an item is crafted. | ||||||
|
|
||||||
|
|
||||||
| ## Available flags | ||||||
|
|
||||||
| | Flag Name | Behavior without flag | Behavior with flag | | ||||||
| | --------- | ---------------- | ------------------ | | ||||||
| | `consume_buckets` | Filled buckets are replaced by empty buckets | Filled buckets are consumed | | ||||||
| | `consume_tools` | Tools durability decrease at every craft | Tools are totally consumed | | ||||||
|
|
||||||
|
|
||||||
| ## Example : | ||||||
|
|
||||||
| Flags have to be set when your recipe succeeds, for example in a shapeless recipe : | ||||||
|
|
||||||
| ```{code-block} mcfunction | ||||||
| :force: | ||||||
| execute | ||||||
| store result score @s smithed.data | ||||||
| if entity @s[scores={smithed.data=0}] | ||||||
| if score count smithed.data matches 2 | ||||||
| if data storage smithed.crafter:input {recipe:<ShapelessRecipe>} | ||||||
| run function ./give_result: | ||||||
| loot replace block ~ ~ ~ container.16 loot example:my_craft | ||||||
| # Set the flags here, so that the water bucket is consumed, and the diamond axe is consumed too. | ||||||
| data modify storage smithed.crafter:input flags append value "consume_buckets" | ||||||
| data modify storage smithed.crafter:input flags append value "consume_tools" | ||||||
| ``` | ||||||
| Where ShapelessRecipe is : | ||||||
| ```SNBT | ||||||
| [ | ||||||
| {id:"minecraft:water_bucket",count:1}, | ||||||
| {id:"minecraft:diamond_axe",count:1} | ||||||
| ] | ||||||
| ``` | ||||||
|
|
||||||
|
|
||||||
| ## Add a custom flag | ||||||
|
|
||||||
| To create your own flag, first pick up a unique name for your flag, for example `namespace:my_flag`. And add it to your recipe like the example above. | ||||||
|
|
||||||
| ### `#smithed.crafter:event/advanced_remove` | ||||||
|
|
||||||
| Register a function to to this function tag, this function has the following inputs : | ||||||
|
|
||||||
| | Input Name | Input Type | Input Source | Input Objective/Path | | ||||||
| | --- | --- | --- | --- | | ||||||
| | 'Item to process' | entity | @s | weapon.mainhand | | ||||||
| | 'Flags list' | storage | smithed.crafter:input | flags | | ||||||
|
|
||||||
| And you need update the following output : | ||||||
|
edayot marked this conversation as resolved.
Outdated
|
||||||
|
|
||||||
| | Output Name | Output Type | Output Destination | Output Objective/Path | | ||||||
| | --- | --- | --- | --- | | ||||||
| | 'Success of operation' | score | $temp | smithed.data | | ||||||
| | 'Item to replace in the crafter' | entity | @s | weapon.mainhand | | ||||||
|
|
||||||
| The default value of 'Success of operation' is 0, which by default juste remove one item. This whould be the default behavior if your flag is not present. If your flag is present and you want to change the item, set it to 1. | ||||||
|
edayot marked this conversation as resolved.
Outdated
|
||||||
| The default value of 'Success of operation' is 0, which by default juste remove one item. This whould be the default behavior if your flag is not present. If your flag is present and you want to change the item, set it to 1. | |
| The default value of 'Success of operation' is 0, which by default just remove one item. This whould be the default behavior if your flag is not present. If your flag is present and you want to change the item, set it to 1. |
This file contains hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -77,4 +77,5 @@ Documentation for the implementing crafting recipes | |
| :hidden: | ||
| data_types | ||
| function_tag | ||
| flags | ||
| ``` | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.