-
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
base: main
Are you sure you want to change the base?
update docs #19
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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 : | ||||||||||
|
||||||||||
| And you need update the following output : | |
| And you need to update the following output : |
Copilot
AI
Dec 28, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a spelling error in "whould" which should be "would".
| 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 juste remove one item. This would 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. |
Copilot
AI
Dec 28, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a spelling error in "juste" which should be "just".
| 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. |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -101,12 +101,24 @@ Where ShapelessRecipe is : | |||||
| ] | ||||||
| ``` | ||||||
|
|
||||||
| ## `#smithed.crafter:event/query_tags` | ||||||
|
|
||||||
| ## Advanced uses : | ||||||
| A list of advanced uses of the crafter library. | ||||||
| By default, crafter provides all vanilla items tags, but you can add your own tags to be queried during crafting. | ||||||
|
|
||||||
| - [Flags](https://github.com/Smithed-MC/Libraries/blob/main/smithed_libraries/packs/crafter/data/smithed.crafter/functions/impl/block/table/crafting/output/clear_input/advanced.mcfunction) To register custom flags when crafting to use tools, empty buckets, etc... | ||||||
| - [Item Tags](https://github.com/Smithed-MC/Libraries/blob/main/smithed_libraries/packs/crafter/data/smithed.crafter/functions/impl/block/table/crafting/input/query_tags.mcfunction) To register custom items tags | ||||||
| - [Custom crafting table](https://github.com/Smithed-MC/Libraries/blob/main/smithed_libraries/packs/crafter/data/smithed.crafter/functions/impl/block/table/break/drop_item.mcfunction) To register your own crafting table. | ||||||
|
|
||||||
| | Input Name | Input Type | Input Source | Input Objective/Path | | ||||||
| | --- | --- | --- | --- | | ||||||
| | 'Item to process' | entity | @s | weapon.mainhand | | ||||||
|
|
||||||
| ### Example : | ||||||
| To add your own tags by adding a line like this : | ||||||
| ```{code-block} mcfunction | ||||||
| execute | ||||||
| if items entity @s weapon.mainhand #namespace:tag_name | ||||||
| run data modify storage smithed.crafter:main root.temp.item_tag append value "#namespace:tag_name" | ||||||
| ``` | ||||||
|
|
||||||
| ## Advanced uses : | ||||||
| A list of advanced uses of the crafter library. | ||||||
|
|
||||||
| - [Custom crafting table](https://github.com/Smithed-MC/Libraries/blob/main/smithed_libraries/packs/crafter/data/smithed.crafter/function/impl/block/table/break/drop_item.mcfunction) To register your own crafting table. | ||||||
|
||||||
| - [Custom crafting table](https://github.com/Smithed-MC/Libraries/blob/main/smithed_libraries/packs/crafter/data/smithed.crafter/function/impl/block/table/break/drop_item.mcfunction) To register your own crafting table. | |
| - [Custom crafting table](https://github.com/Smithed-MC/Libraries/blob/main/smithed_libraries/packs/crafter/data/smithed.crafter/functions/impl/block/table/break/drop_item.mcfunction) To register your own crafting table. |
| 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 | ||
| ``` | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a grammatical error in the sentence. "Register a function to to this function tag" contains a duplicated "to". It should be "Register a function to this function tag".