From ffadb34a8c9c69323125c318854f50c50ac9b979 Mon Sep 17 00:00:00 2001 From: KonSola5 <125081901+KonSola5@users.noreply.github.com> Date: Fri, 24 Oct 2025 14:45:27 +0200 Subject: [PATCH 01/15] Add an example for looping --- wiki/tutorials/recipes/page.kubedoc | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/wiki/tutorials/recipes/page.kubedoc b/wiki/tutorials/recipes/page.kubedoc index 19d82831..3c07672b 100644 --- a/wiki/tutorials/recipes/page.kubedoc +++ b/wiki/tutorials/recipes/page.kubedoc @@ -297,3 +297,31 @@ ServerEvents.recipes(event => { ## Looping In addition to helper functions, you can also loop through an array to perform an action on every item in the array. + +```js +ServerEvents.recipes(event => { + /** Array of all colors available in Minecraft. */ + const colors = [ + 'black', + 'blue', + 'brown', + 'cyan', + 'gray', + 'green', + 'light_blue', + 'light_gray', + 'lime', + 'magenta', + 'orange', + 'pink', + 'purple', + 'red', + 'white', + 'yellow', + ] + // Now we can loop over that array without needing to specify a separate recipe for each color! + colors.forEach(color => { + event.shapeless(`kubejs:${color}_clay`, ['minecraft:clay', `minecraft:${color}_dye`]) + }) +}) +``` \ No newline at end of file From 1adde99a03e7bfbacf683b46e8dc131b5e8c2eac Mon Sep 17 00:00:00 2001 From: KonSola5 <125081901+KonSola5@users.noreply.github.com> Date: Fri, 24 Oct 2025 15:25:06 +0200 Subject: [PATCH 02/15] There's Color.DYE, and add another example wth custom array --- wiki/tutorials/recipes/page.kubedoc | 32 ++++++++++------------------- 1 file changed, 11 insertions(+), 21 deletions(-) diff --git a/wiki/tutorials/recipes/page.kubedoc b/wiki/tutorials/recipes/page.kubedoc index 3c07672b..df104148 100644 --- a/wiki/tutorials/recipes/page.kubedoc +++ b/wiki/tutorials/recipes/page.kubedoc @@ -300,28 +300,18 @@ In addition to helper functions, you can also loop through an array to perform a ```js ServerEvents.recipes(event => { - /** Array of all colors available in Minecraft. */ - const colors = [ - 'black', - 'blue', - 'brown', - 'cyan', - 'gray', - 'green', - 'light_blue', - 'light_gray', - 'lime', - 'magenta', - 'orange', - 'pink', - 'purple', - 'red', - 'white', - 'yellow', - ] - // Now we can loop over that array without needing to specify a separate recipe for each color! - colors.forEach(color => { + // There's a useful built-in array that contains all the dye colors. + // It can be looped over using `forEach`, so you don't need to specify a separate recipe for each color! + Color.DYE.forEach(color => { event.shapeless(`kubejs:${color}_clay`, ['minecraft:clay', `minecraft:${color}_dye`]) }) + + // You can also create your own arrays... + const metals = ['iron', 'copper', 'gold', 'netherite'] + // ... and loop over them the same way! + metals.forEach(metal => { + event.shapeless(`kubejs:${metal}_plate`, [`minecraft:${metal}_ingot`, 'kubejs:hammer']) + .damageIngredient('kubejs:hammer') + }) }) ``` \ No newline at end of file From 708375f31849895ed2361eac96d16c46e810d193 Mon Sep 17 00:00:00 2001 From: KonSola5 <125081901+KonSola5@users.noreply.github.com> Date: Fri, 24 Oct 2025 17:40:16 +0200 Subject: [PATCH 03/15] Is using Prettier a good idea? --- .../tutorials/block-interactions/page.kubedoc | 77 ++++++++++++------- 1 file changed, 51 insertions(+), 26 deletions(-) diff --git a/wiki/tutorials/block-interactions/page.kubedoc b/wiki/tutorials/block-interactions/page.kubedoc index 35936634..d7022841 100644 --- a/wiki/tutorials/block-interactions/page.kubedoc +++ b/wiki/tutorials/block-interactions/page.kubedoc @@ -1,93 +1,118 @@ All block events listed on this page can be put in {se-s} or {cl-s}. # Broken Event + The block broken event is cancellable. Here's an example of replacing stone with cobblestone once it's broken. |> 1.19.2+ + ```js BlockEvents.broken('minecraft:stone', event => { - event.block.set('minecraft:cobblestone') - event.cancel() + event.block.set('minecraft:cobblestone') + event.cancel() }) ``` + <||> 1.18.2 and below + ```js onEvent('block.break', event => { - if(event.block.id != 'minecraft:stone') return - event.block.set('minecraft:cobblestone') - event.cancel() + if (event.block.id != 'minecraft:stone') return + event.block.set('minecraft:cobblestone') + event.cancel() }) ``` -<| + +<| # Detector Events ->>> warn -WIP -<<< + +> > > warn +> > > WIP +> > > <<< # Farmland Trampled Event + The farmland trampled event is cancellable. ->>> warn -The farmland trampled event only exists on version 1.19.2 and above! -<<< -Here's an example of cancelling the event if the player has boots on with the feather falling 4 enchant + +> > > warn +> > > The farmland trampled event only exists on version 1.19.2 and above! +> > > <<< +> > > Here's an example of cancelling the event if the player has boots on with the feather falling 4 enchant + ```js BlockEvents.farmlandTrampled(event => { - if(event.player.feetArmorItem.hasEnchantment('minecraft:feather_falling', 4)) e.cancel() + if (event.player.feetArmorItem.hasEnchantment('minecraft:feather_falling', 4)) + e.cancel() }) ``` # Left Clicked Event + The left click event is cancellable. Here's an example of giving the player stone when left clicking sand, and removing the sand. |> 1.19.2+ + ```js BlockEvents.leftClicked('minecraft:sand', event => { - event.player.give('minecraft:cobblestone') - event.block.set('minecraft:air') + event.player.give('minecraft:cobblestone') + event.block.set('minecraft:air') }) ``` + <||> 1.18.2 and below + ```js onEvent('block.left_click', event => { - if(event.block.id != 'minecraft:sand') return - event.player.give('minecraft:cobblestone') - event.block.set('minecraft:air') + if (event.block.id != 'minecraft:sand') return + event.player.give('minecraft:cobblestone') + event.block.set('minecraft:air') }) ``` + <| # Placed Event + The block placed event is cancellable. Here's an example of replacing a crafting table with an oak log when placed. |> 1.19.2+ + ```js BlockEvents.placed('minecraft:crafting_table', event => { - event.player.tell('NO CRAFTING FOR YOU') - event.block.set('minecraft:oak_log') + event.player.tell('NO CRAFTING FOR YOU') + event.block.set('minecraft:oak_log') }) ``` + <||> 1.18.2 and below + ```js onEvent('block.place', event => { - if(event.block.id != 'minecraft:crafting_table') return - event.player.tell('NO CRAFTING FOR YOU') - event.block.set('minecraft:oak_log') + if (event.block.id != 'minecraft:crafting_table') return + event.player.tell('NO CRAFTING FOR YOU') + event.block.set('minecraft:oak_log') }) ``` + <| # Right Clicked Event + The right click event is cancellable. Here's an example of cancelling the event when right clicking chests. |> 1.19.2+ + ```js BlockEvents.rightClicked('minecraft:chest', event => event.cancel()) ``` + <||> 1.18.2 and below + ```js onEvent('block.right_click', event => { - if(event.block.id == 'minecraft:chest') event.cancel() + if (event.block.id == 'minecraft:chest') event.cancel() }) ``` -<| \ No newline at end of file + +<| From 6a2d9bc81c1f23b83758c328c5cc68975da27310 Mon Sep 17 00:00:00 2001 From: KonSola5 <125081901+KonSola5@users.noreply.github.com> Date: Fri, 24 Oct 2025 17:41:14 +0200 Subject: [PATCH 04/15] Revert "Is using Prettier a good idea?" This reverts commit 708375f31849895ed2361eac96d16c46e810d193. --- .../tutorials/block-interactions/page.kubedoc | 77 +++++++------------ 1 file changed, 26 insertions(+), 51 deletions(-) diff --git a/wiki/tutorials/block-interactions/page.kubedoc b/wiki/tutorials/block-interactions/page.kubedoc index d7022841..35936634 100644 --- a/wiki/tutorials/block-interactions/page.kubedoc +++ b/wiki/tutorials/block-interactions/page.kubedoc @@ -1,118 +1,93 @@ All block events listed on this page can be put in {se-s} or {cl-s}. # Broken Event - The block broken event is cancellable. Here's an example of replacing stone with cobblestone once it's broken. |> 1.19.2+ - ```js BlockEvents.broken('minecraft:stone', event => { - event.block.set('minecraft:cobblestone') - event.cancel() + event.block.set('minecraft:cobblestone') + event.cancel() }) ``` - <||> 1.18.2 and below - ```js onEvent('block.break', event => { - if (event.block.id != 'minecraft:stone') return - event.block.set('minecraft:cobblestone') - event.cancel() + if(event.block.id != 'minecraft:stone') return + event.block.set('minecraft:cobblestone') + event.cancel() }) ``` - -<| +<| # Detector Events - -> > > warn -> > > WIP -> > > <<< +>>> warn +WIP +<<< # Farmland Trampled Event - The farmland trampled event is cancellable. - -> > > warn -> > > The farmland trampled event only exists on version 1.19.2 and above! -> > > <<< -> > > Here's an example of cancelling the event if the player has boots on with the feather falling 4 enchant - +>>> warn +The farmland trampled event only exists on version 1.19.2 and above! +<<< +Here's an example of cancelling the event if the player has boots on with the feather falling 4 enchant ```js BlockEvents.farmlandTrampled(event => { - if (event.player.feetArmorItem.hasEnchantment('minecraft:feather_falling', 4)) - e.cancel() + if(event.player.feetArmorItem.hasEnchantment('minecraft:feather_falling', 4)) e.cancel() }) ``` # Left Clicked Event - The left click event is cancellable. Here's an example of giving the player stone when left clicking sand, and removing the sand. |> 1.19.2+ - ```js BlockEvents.leftClicked('minecraft:sand', event => { - event.player.give('minecraft:cobblestone') - event.block.set('minecraft:air') + event.player.give('minecraft:cobblestone') + event.block.set('minecraft:air') }) ``` - <||> 1.18.2 and below - ```js onEvent('block.left_click', event => { - if (event.block.id != 'minecraft:sand') return - event.player.give('minecraft:cobblestone') - event.block.set('minecraft:air') + if(event.block.id != 'minecraft:sand') return + event.player.give('minecraft:cobblestone') + event.block.set('minecraft:air') }) ``` - <| # Placed Event - The block placed event is cancellable. Here's an example of replacing a crafting table with an oak log when placed. |> 1.19.2+ - ```js BlockEvents.placed('minecraft:crafting_table', event => { - event.player.tell('NO CRAFTING FOR YOU') - event.block.set('minecraft:oak_log') + event.player.tell('NO CRAFTING FOR YOU') + event.block.set('minecraft:oak_log') }) ``` - <||> 1.18.2 and below - ```js onEvent('block.place', event => { - if (event.block.id != 'minecraft:crafting_table') return - event.player.tell('NO CRAFTING FOR YOU') - event.block.set('minecraft:oak_log') + if(event.block.id != 'minecraft:crafting_table') return + event.player.tell('NO CRAFTING FOR YOU') + event.block.set('minecraft:oak_log') }) ``` - <| # Right Clicked Event - The right click event is cancellable. Here's an example of cancelling the event when right clicking chests. |> 1.19.2+ - ```js BlockEvents.rightClicked('minecraft:chest', event => event.cancel()) ``` - <||> 1.18.2 and below - ```js onEvent('block.right_click', event => { - if (event.block.id == 'minecraft:chest') event.cancel() + if(event.block.id == 'minecraft:chest') event.cancel() }) ``` - -<| +<| \ No newline at end of file From 08c0f1fdd2a96d99542e9a7826f11389d873d977 Mon Sep 17 00:00:00 2001 From: KonSola5 <125081901+KonSola5@users.noreply.github.com> Date: Fri, 31 Oct 2025 21:45:43 +0100 Subject: [PATCH 05/15] ServerEvents.recipes test --- .../recipes/event-fields/addRecipe/meta.yml | 2 + .../event-fields/addedRecipes/meta.yml | 2 + .../recipes/event-fields/blasting/meta.yml | 2 + .../event-fields/campfireCooking/meta.yml | 2 + .../event-fields/containsRecipe/meta.yml | 2 + .../event-fields/countRecipes/meta.yml | 2 + .../recipes/event-fields/custom/meta.yml | 2 + .../event-fields/customFilter/meta.yml | 2 + .../recipes/event-fields/failedCount/meta.yml | 2 + .../event-fields/findRecipeIds/meta.yml | 2 + .../recipes/event-fields/findRecipes/meta.yml | 2 + .../event-fields/forEachRecipe/meta.yml | 2 + .../event-fields/getRecipeFunction/meta.yml | 2 + .../recipes/event-fields/getRecipes/meta.yml | 2 + .../recipes/event-fields/itemErrors/meta.yml | 2 + .../recipes/event-fields/meta.yml | 2 + .../event-fields/originalRecipes/meta.yml | 2 + .../event-fields/printAllTypes/meta.yml | 2 + .../event-fields/printExamples/meta.yml | 2 + .../recipes/event-fields/printTypes/meta.yml | 2 + .../event-fields/recipeStream/meta.yml | 2 + .../recipes/event-fields/recipes/meta.yml | 2 + .../recipes/event-fields/remove/meta.yml | 2 + .../event-fields/replaceInput/meta.yml | 2 + .../event-fields/replaceOutput/meta.yml | 2 + .../recipes/event-fields/shaped/meta.yml | 2 + .../recipes/event-fields/shapeless/meta.yml | 2 + .../event-fields/shapeless/page.kubedoc | 0 .../recipes/event-fields/smelting/meta.yml | 2 + .../recipes/event-fields/smithing/meta.yml | 2 + .../event-fields/smithingTrim/meta.yml | 2 + .../recipes/event-fields/smoking/meta.yml | 2 + .../recipes/event-fields/stage/meta.yml | 2 + .../event-fields/stonecutting/meta.yml | 2 + .../recipes/event-fields/takeId/meta.yml | 2 + .../recipes/event-fields/takenIds/meta.yml | 2 + wiki/events/ServerEvents/recipes/page.kubedoc | 56 +++++++++++++++++++ 37 files changed, 126 insertions(+) create mode 100644 wiki/events/ServerEvents/recipes/event-fields/addRecipe/meta.yml create mode 100644 wiki/events/ServerEvents/recipes/event-fields/addedRecipes/meta.yml create mode 100644 wiki/events/ServerEvents/recipes/event-fields/blasting/meta.yml create mode 100644 wiki/events/ServerEvents/recipes/event-fields/campfireCooking/meta.yml create mode 100644 wiki/events/ServerEvents/recipes/event-fields/containsRecipe/meta.yml create mode 100644 wiki/events/ServerEvents/recipes/event-fields/countRecipes/meta.yml create mode 100644 wiki/events/ServerEvents/recipes/event-fields/custom/meta.yml create mode 100644 wiki/events/ServerEvents/recipes/event-fields/customFilter/meta.yml create mode 100644 wiki/events/ServerEvents/recipes/event-fields/failedCount/meta.yml create mode 100644 wiki/events/ServerEvents/recipes/event-fields/findRecipeIds/meta.yml create mode 100644 wiki/events/ServerEvents/recipes/event-fields/findRecipes/meta.yml create mode 100644 wiki/events/ServerEvents/recipes/event-fields/forEachRecipe/meta.yml create mode 100644 wiki/events/ServerEvents/recipes/event-fields/getRecipeFunction/meta.yml create mode 100644 wiki/events/ServerEvents/recipes/event-fields/getRecipes/meta.yml create mode 100644 wiki/events/ServerEvents/recipes/event-fields/itemErrors/meta.yml create mode 100644 wiki/events/ServerEvents/recipes/event-fields/meta.yml create mode 100644 wiki/events/ServerEvents/recipes/event-fields/originalRecipes/meta.yml create mode 100644 wiki/events/ServerEvents/recipes/event-fields/printAllTypes/meta.yml create mode 100644 wiki/events/ServerEvents/recipes/event-fields/printExamples/meta.yml create mode 100644 wiki/events/ServerEvents/recipes/event-fields/printTypes/meta.yml create mode 100644 wiki/events/ServerEvents/recipes/event-fields/recipeStream/meta.yml create mode 100644 wiki/events/ServerEvents/recipes/event-fields/recipes/meta.yml create mode 100644 wiki/events/ServerEvents/recipes/event-fields/remove/meta.yml create mode 100644 wiki/events/ServerEvents/recipes/event-fields/replaceInput/meta.yml create mode 100644 wiki/events/ServerEvents/recipes/event-fields/replaceOutput/meta.yml create mode 100644 wiki/events/ServerEvents/recipes/event-fields/shaped/meta.yml create mode 100644 wiki/events/ServerEvents/recipes/event-fields/shapeless/meta.yml create mode 100644 wiki/events/ServerEvents/recipes/event-fields/shapeless/page.kubedoc create mode 100644 wiki/events/ServerEvents/recipes/event-fields/smelting/meta.yml create mode 100644 wiki/events/ServerEvents/recipes/event-fields/smithing/meta.yml create mode 100644 wiki/events/ServerEvents/recipes/event-fields/smithingTrim/meta.yml create mode 100644 wiki/events/ServerEvents/recipes/event-fields/smoking/meta.yml create mode 100644 wiki/events/ServerEvents/recipes/event-fields/stage/meta.yml create mode 100644 wiki/events/ServerEvents/recipes/event-fields/stonecutting/meta.yml create mode 100644 wiki/events/ServerEvents/recipes/event-fields/takeId/meta.yml create mode 100644 wiki/events/ServerEvents/recipes/event-fields/takenIds/meta.yml create mode 100644 wiki/events/ServerEvents/recipes/page.kubedoc diff --git a/wiki/events/ServerEvents/recipes/event-fields/addRecipe/meta.yml b/wiki/events/ServerEvents/recipes/event-fields/addRecipe/meta.yml new file mode 100644 index 00000000..f2a869e4 --- /dev/null +++ b/wiki/events/ServerEvents/recipes/event-fields/addRecipe/meta.yml @@ -0,0 +1,2 @@ +script: "server" +see-also: "$ServerEvents/recipes" \ No newline at end of file diff --git a/wiki/events/ServerEvents/recipes/event-fields/addedRecipes/meta.yml b/wiki/events/ServerEvents/recipes/event-fields/addedRecipes/meta.yml new file mode 100644 index 00000000..f2a869e4 --- /dev/null +++ b/wiki/events/ServerEvents/recipes/event-fields/addedRecipes/meta.yml @@ -0,0 +1,2 @@ +script: "server" +see-also: "$ServerEvents/recipes" \ No newline at end of file diff --git a/wiki/events/ServerEvents/recipes/event-fields/blasting/meta.yml b/wiki/events/ServerEvents/recipes/event-fields/blasting/meta.yml new file mode 100644 index 00000000..f2a869e4 --- /dev/null +++ b/wiki/events/ServerEvents/recipes/event-fields/blasting/meta.yml @@ -0,0 +1,2 @@ +script: "server" +see-also: "$ServerEvents/recipes" \ No newline at end of file diff --git a/wiki/events/ServerEvents/recipes/event-fields/campfireCooking/meta.yml b/wiki/events/ServerEvents/recipes/event-fields/campfireCooking/meta.yml new file mode 100644 index 00000000..f2a869e4 --- /dev/null +++ b/wiki/events/ServerEvents/recipes/event-fields/campfireCooking/meta.yml @@ -0,0 +1,2 @@ +script: "server" +see-also: "$ServerEvents/recipes" \ No newline at end of file diff --git a/wiki/events/ServerEvents/recipes/event-fields/containsRecipe/meta.yml b/wiki/events/ServerEvents/recipes/event-fields/containsRecipe/meta.yml new file mode 100644 index 00000000..f2a869e4 --- /dev/null +++ b/wiki/events/ServerEvents/recipes/event-fields/containsRecipe/meta.yml @@ -0,0 +1,2 @@ +script: "server" +see-also: "$ServerEvents/recipes" \ No newline at end of file diff --git a/wiki/events/ServerEvents/recipes/event-fields/countRecipes/meta.yml b/wiki/events/ServerEvents/recipes/event-fields/countRecipes/meta.yml new file mode 100644 index 00000000..f2a869e4 --- /dev/null +++ b/wiki/events/ServerEvents/recipes/event-fields/countRecipes/meta.yml @@ -0,0 +1,2 @@ +script: "server" +see-also: "$ServerEvents/recipes" \ No newline at end of file diff --git a/wiki/events/ServerEvents/recipes/event-fields/custom/meta.yml b/wiki/events/ServerEvents/recipes/event-fields/custom/meta.yml new file mode 100644 index 00000000..f2a869e4 --- /dev/null +++ b/wiki/events/ServerEvents/recipes/event-fields/custom/meta.yml @@ -0,0 +1,2 @@ +script: "server" +see-also: "$ServerEvents/recipes" \ No newline at end of file diff --git a/wiki/events/ServerEvents/recipes/event-fields/customFilter/meta.yml b/wiki/events/ServerEvents/recipes/event-fields/customFilter/meta.yml new file mode 100644 index 00000000..f2a869e4 --- /dev/null +++ b/wiki/events/ServerEvents/recipes/event-fields/customFilter/meta.yml @@ -0,0 +1,2 @@ +script: "server" +see-also: "$ServerEvents/recipes" \ No newline at end of file diff --git a/wiki/events/ServerEvents/recipes/event-fields/failedCount/meta.yml b/wiki/events/ServerEvents/recipes/event-fields/failedCount/meta.yml new file mode 100644 index 00000000..f2a869e4 --- /dev/null +++ b/wiki/events/ServerEvents/recipes/event-fields/failedCount/meta.yml @@ -0,0 +1,2 @@ +script: "server" +see-also: "$ServerEvents/recipes" \ No newline at end of file diff --git a/wiki/events/ServerEvents/recipes/event-fields/findRecipeIds/meta.yml b/wiki/events/ServerEvents/recipes/event-fields/findRecipeIds/meta.yml new file mode 100644 index 00000000..f2a869e4 --- /dev/null +++ b/wiki/events/ServerEvents/recipes/event-fields/findRecipeIds/meta.yml @@ -0,0 +1,2 @@ +script: "server" +see-also: "$ServerEvents/recipes" \ No newline at end of file diff --git a/wiki/events/ServerEvents/recipes/event-fields/findRecipes/meta.yml b/wiki/events/ServerEvents/recipes/event-fields/findRecipes/meta.yml new file mode 100644 index 00000000..f2a869e4 --- /dev/null +++ b/wiki/events/ServerEvents/recipes/event-fields/findRecipes/meta.yml @@ -0,0 +1,2 @@ +script: "server" +see-also: "$ServerEvents/recipes" \ No newline at end of file diff --git a/wiki/events/ServerEvents/recipes/event-fields/forEachRecipe/meta.yml b/wiki/events/ServerEvents/recipes/event-fields/forEachRecipe/meta.yml new file mode 100644 index 00000000..f2a869e4 --- /dev/null +++ b/wiki/events/ServerEvents/recipes/event-fields/forEachRecipe/meta.yml @@ -0,0 +1,2 @@ +script: "server" +see-also: "$ServerEvents/recipes" \ No newline at end of file diff --git a/wiki/events/ServerEvents/recipes/event-fields/getRecipeFunction/meta.yml b/wiki/events/ServerEvents/recipes/event-fields/getRecipeFunction/meta.yml new file mode 100644 index 00000000..f2a869e4 --- /dev/null +++ b/wiki/events/ServerEvents/recipes/event-fields/getRecipeFunction/meta.yml @@ -0,0 +1,2 @@ +script: "server" +see-also: "$ServerEvents/recipes" \ No newline at end of file diff --git a/wiki/events/ServerEvents/recipes/event-fields/getRecipes/meta.yml b/wiki/events/ServerEvents/recipes/event-fields/getRecipes/meta.yml new file mode 100644 index 00000000..f2a869e4 --- /dev/null +++ b/wiki/events/ServerEvents/recipes/event-fields/getRecipes/meta.yml @@ -0,0 +1,2 @@ +script: "server" +see-also: "$ServerEvents/recipes" \ No newline at end of file diff --git a/wiki/events/ServerEvents/recipes/event-fields/itemErrors/meta.yml b/wiki/events/ServerEvents/recipes/event-fields/itemErrors/meta.yml new file mode 100644 index 00000000..f2a869e4 --- /dev/null +++ b/wiki/events/ServerEvents/recipes/event-fields/itemErrors/meta.yml @@ -0,0 +1,2 @@ +script: "server" +see-also: "$ServerEvents/recipes" \ No newline at end of file diff --git a/wiki/events/ServerEvents/recipes/event-fields/meta.yml b/wiki/events/ServerEvents/recipes/event-fields/meta.yml new file mode 100644 index 00000000..f2a869e4 --- /dev/null +++ b/wiki/events/ServerEvents/recipes/event-fields/meta.yml @@ -0,0 +1,2 @@ +script: "server" +see-also: "$ServerEvents/recipes" \ No newline at end of file diff --git a/wiki/events/ServerEvents/recipes/event-fields/originalRecipes/meta.yml b/wiki/events/ServerEvents/recipes/event-fields/originalRecipes/meta.yml new file mode 100644 index 00000000..f2a869e4 --- /dev/null +++ b/wiki/events/ServerEvents/recipes/event-fields/originalRecipes/meta.yml @@ -0,0 +1,2 @@ +script: "server" +see-also: "$ServerEvents/recipes" \ No newline at end of file diff --git a/wiki/events/ServerEvents/recipes/event-fields/printAllTypes/meta.yml b/wiki/events/ServerEvents/recipes/event-fields/printAllTypes/meta.yml new file mode 100644 index 00000000..f2a869e4 --- /dev/null +++ b/wiki/events/ServerEvents/recipes/event-fields/printAllTypes/meta.yml @@ -0,0 +1,2 @@ +script: "server" +see-also: "$ServerEvents/recipes" \ No newline at end of file diff --git a/wiki/events/ServerEvents/recipes/event-fields/printExamples/meta.yml b/wiki/events/ServerEvents/recipes/event-fields/printExamples/meta.yml new file mode 100644 index 00000000..f2a869e4 --- /dev/null +++ b/wiki/events/ServerEvents/recipes/event-fields/printExamples/meta.yml @@ -0,0 +1,2 @@ +script: "server" +see-also: "$ServerEvents/recipes" \ No newline at end of file diff --git a/wiki/events/ServerEvents/recipes/event-fields/printTypes/meta.yml b/wiki/events/ServerEvents/recipes/event-fields/printTypes/meta.yml new file mode 100644 index 00000000..f2a869e4 --- /dev/null +++ b/wiki/events/ServerEvents/recipes/event-fields/printTypes/meta.yml @@ -0,0 +1,2 @@ +script: "server" +see-also: "$ServerEvents/recipes" \ No newline at end of file diff --git a/wiki/events/ServerEvents/recipes/event-fields/recipeStream/meta.yml b/wiki/events/ServerEvents/recipes/event-fields/recipeStream/meta.yml new file mode 100644 index 00000000..f2a869e4 --- /dev/null +++ b/wiki/events/ServerEvents/recipes/event-fields/recipeStream/meta.yml @@ -0,0 +1,2 @@ +script: "server" +see-also: "$ServerEvents/recipes" \ No newline at end of file diff --git a/wiki/events/ServerEvents/recipes/event-fields/recipes/meta.yml b/wiki/events/ServerEvents/recipes/event-fields/recipes/meta.yml new file mode 100644 index 00000000..f2a869e4 --- /dev/null +++ b/wiki/events/ServerEvents/recipes/event-fields/recipes/meta.yml @@ -0,0 +1,2 @@ +script: "server" +see-also: "$ServerEvents/recipes" \ No newline at end of file diff --git a/wiki/events/ServerEvents/recipes/event-fields/remove/meta.yml b/wiki/events/ServerEvents/recipes/event-fields/remove/meta.yml new file mode 100644 index 00000000..f2a869e4 --- /dev/null +++ b/wiki/events/ServerEvents/recipes/event-fields/remove/meta.yml @@ -0,0 +1,2 @@ +script: "server" +see-also: "$ServerEvents/recipes" \ No newline at end of file diff --git a/wiki/events/ServerEvents/recipes/event-fields/replaceInput/meta.yml b/wiki/events/ServerEvents/recipes/event-fields/replaceInput/meta.yml new file mode 100644 index 00000000..f2a869e4 --- /dev/null +++ b/wiki/events/ServerEvents/recipes/event-fields/replaceInput/meta.yml @@ -0,0 +1,2 @@ +script: "server" +see-also: "$ServerEvents/recipes" \ No newline at end of file diff --git a/wiki/events/ServerEvents/recipes/event-fields/replaceOutput/meta.yml b/wiki/events/ServerEvents/recipes/event-fields/replaceOutput/meta.yml new file mode 100644 index 00000000..f2a869e4 --- /dev/null +++ b/wiki/events/ServerEvents/recipes/event-fields/replaceOutput/meta.yml @@ -0,0 +1,2 @@ +script: "server" +see-also: "$ServerEvents/recipes" \ No newline at end of file diff --git a/wiki/events/ServerEvents/recipes/event-fields/shaped/meta.yml b/wiki/events/ServerEvents/recipes/event-fields/shaped/meta.yml new file mode 100644 index 00000000..f2a869e4 --- /dev/null +++ b/wiki/events/ServerEvents/recipes/event-fields/shaped/meta.yml @@ -0,0 +1,2 @@ +script: "server" +see-also: "$ServerEvents/recipes" \ No newline at end of file diff --git a/wiki/events/ServerEvents/recipes/event-fields/shapeless/meta.yml b/wiki/events/ServerEvents/recipes/event-fields/shapeless/meta.yml new file mode 100644 index 00000000..f2a869e4 --- /dev/null +++ b/wiki/events/ServerEvents/recipes/event-fields/shapeless/meta.yml @@ -0,0 +1,2 @@ +script: "server" +see-also: "$ServerEvents/recipes" \ No newline at end of file diff --git a/wiki/events/ServerEvents/recipes/event-fields/shapeless/page.kubedoc b/wiki/events/ServerEvents/recipes/event-fields/shapeless/page.kubedoc new file mode 100644 index 00000000..e69de29b diff --git a/wiki/events/ServerEvents/recipes/event-fields/smelting/meta.yml b/wiki/events/ServerEvents/recipes/event-fields/smelting/meta.yml new file mode 100644 index 00000000..f2a869e4 --- /dev/null +++ b/wiki/events/ServerEvents/recipes/event-fields/smelting/meta.yml @@ -0,0 +1,2 @@ +script: "server" +see-also: "$ServerEvents/recipes" \ No newline at end of file diff --git a/wiki/events/ServerEvents/recipes/event-fields/smithing/meta.yml b/wiki/events/ServerEvents/recipes/event-fields/smithing/meta.yml new file mode 100644 index 00000000..f2a869e4 --- /dev/null +++ b/wiki/events/ServerEvents/recipes/event-fields/smithing/meta.yml @@ -0,0 +1,2 @@ +script: "server" +see-also: "$ServerEvents/recipes" \ No newline at end of file diff --git a/wiki/events/ServerEvents/recipes/event-fields/smithingTrim/meta.yml b/wiki/events/ServerEvents/recipes/event-fields/smithingTrim/meta.yml new file mode 100644 index 00000000..f2a869e4 --- /dev/null +++ b/wiki/events/ServerEvents/recipes/event-fields/smithingTrim/meta.yml @@ -0,0 +1,2 @@ +script: "server" +see-also: "$ServerEvents/recipes" \ No newline at end of file diff --git a/wiki/events/ServerEvents/recipes/event-fields/smoking/meta.yml b/wiki/events/ServerEvents/recipes/event-fields/smoking/meta.yml new file mode 100644 index 00000000..f2a869e4 --- /dev/null +++ b/wiki/events/ServerEvents/recipes/event-fields/smoking/meta.yml @@ -0,0 +1,2 @@ +script: "server" +see-also: "$ServerEvents/recipes" \ No newline at end of file diff --git a/wiki/events/ServerEvents/recipes/event-fields/stage/meta.yml b/wiki/events/ServerEvents/recipes/event-fields/stage/meta.yml new file mode 100644 index 00000000..f2a869e4 --- /dev/null +++ b/wiki/events/ServerEvents/recipes/event-fields/stage/meta.yml @@ -0,0 +1,2 @@ +script: "server" +see-also: "$ServerEvents/recipes" \ No newline at end of file diff --git a/wiki/events/ServerEvents/recipes/event-fields/stonecutting/meta.yml b/wiki/events/ServerEvents/recipes/event-fields/stonecutting/meta.yml new file mode 100644 index 00000000..f2a869e4 --- /dev/null +++ b/wiki/events/ServerEvents/recipes/event-fields/stonecutting/meta.yml @@ -0,0 +1,2 @@ +script: "server" +see-also: "$ServerEvents/recipes" \ No newline at end of file diff --git a/wiki/events/ServerEvents/recipes/event-fields/takeId/meta.yml b/wiki/events/ServerEvents/recipes/event-fields/takeId/meta.yml new file mode 100644 index 00000000..f2a869e4 --- /dev/null +++ b/wiki/events/ServerEvents/recipes/event-fields/takeId/meta.yml @@ -0,0 +1,2 @@ +script: "server" +see-also: "$ServerEvents/recipes" \ No newline at end of file diff --git a/wiki/events/ServerEvents/recipes/event-fields/takenIds/meta.yml b/wiki/events/ServerEvents/recipes/event-fields/takenIds/meta.yml new file mode 100644 index 00000000..f2a869e4 --- /dev/null +++ b/wiki/events/ServerEvents/recipes/event-fields/takenIds/meta.yml @@ -0,0 +1,2 @@ +script: "server" +see-also: "$ServerEvents/recipes" \ No newline at end of file diff --git a/wiki/events/ServerEvents/recipes/page.kubedoc b/wiki/events/ServerEvents/recipes/page.kubedoc new file mode 100644 index 00000000..0b9b63af --- /dev/null +++ b/wiki/events/ServerEvents/recipes/page.kubedoc @@ -0,0 +1,56 @@ +The `[js]ServerEvents.recipes` event handler handles recipe addition and removal. + +# Syntax +```js +ServerEvents.recipes(handler) +ServerEvents.recipes(event => { + // ... +}) +``` + +# Parameters + +- `[js]handler`: A callback function which gets executed when the event is fired. Return value is discarded. +The function is called with the following parameters: + - `[js]event`: Contains [event fields](#event-fields) that (???) + +# Event Fields +## Unique to this event +- `[js]event.addRecipe`: TODO +- `[js]event.addedRecipes`: Contains the list of all added recipes. +- `[js]event.blasting`: Creates a new recipe for the Blast Furnace. +- `[js]event.campfireCooking`: Creates a new recipe for the Campfire. +- `[js]event.containsRecipe`: TODO +- `[js]event.countRecipes`: TODO +- `[js]event.custom`: Creates an arbitrary JSON recipe. +- `[js]event.customFilter`: TODO +- `[js]event.failedCount`: TODO +- `[js]event.findRecipeIds`: TODO +- `[js]event.findRecipes`: TODO +- `[js]event.forEachRecipe`: Executes a provided function for each recipe that matches a given filter. +- `[js]event.getRecipeFunction`: TODO +- `[js]event.getRecipes`: TODO +- `[js]event.itemErrors` ==Setter only==: TODO +- `[js]event.originalRecipes`: TODO +- `[js]event.printAllTypes`: TODO +- `[js]event.printExamples`: A function, that prints example recipes into the game console. +- `[js]event.printTypes`: TODO +- `[js]event.recipeStream`: TODO +- `[js]event.recipes`: A map, that contains recipe types for various mods. Addons may add new recipe types here. +- `[js]event.remove`: A function, that removes all recipes that match a given filter. +- `[js]event.replaceInput`: A function, that replaces inputs of all recipes that match a given filter. +- `[js]event.replaceOutput`: A function, that replaces inputs of all recipes that match a given filter. +- `[js]event.shaped`: A function, that creates a new shaped crafting recipe. +- `[js]event.shapeless`: A function, that creates a new shapeless crafting recipe. +- `[js]event.smelting`: A function, that creates a new Furnace smelting recipe. +- `[js]event.smithing`: A function that creates a new Smithing Table smithing recipe. +- `[js]event.smithingTrim`: A function that creates a new Smithing Table smithing recipe for applying an Armor Trim. +- `[js]event.smoking`: A function, that creates a new Smoker smoking recipe. +- `[js]event.stage`: TODO +- `[js]event.stonecutting`: A function, that creates a new Stonecutter stonecutting recipe. +- `[js]event.takeId`: TODO +- `[js]event.takenIds`: TODO +## Common to all events +- `[js]event.cancel`: Cancels the event with a given exit value. Execution will be stopped **immediately**. +- `[js]event.exit`: Stops the event with default exit value. Execution will be stopped **immediately**. +- `[js]event.success`: Stops the event as a success with the given exit value. Execution will be stopped **immediately**. \ No newline at end of file From c11dda02b9a4e2406a42e659bdd7f432e9a92d7c Mon Sep 17 00:00:00 2001 From: KonSola5 <125081901+KonSola5@users.noreply.github.com> Date: Fri, 31 Oct 2025 21:59:22 +0100 Subject: [PATCH 06/15] Title for Event Fields, will link work? --- wiki/events/ServerEvents/recipes/event-fields/en.yml | 5 +++++ wiki/events/ServerEvents/recipes/event-fields/page.kubedoc | 2 ++ .../ServerEvents/recipes/event-fields/shapeless/page.kubedoc | 1 + wiki/events/ServerEvents/recipes/page.kubedoc | 3 ++- 4 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 wiki/events/ServerEvents/recipes/event-fields/en.yml create mode 100644 wiki/events/ServerEvents/recipes/event-fields/page.kubedoc diff --git a/wiki/events/ServerEvents/recipes/event-fields/en.yml b/wiki/events/ServerEvents/recipes/event-fields/en.yml new file mode 100644 index 00000000..0f03360b --- /dev/null +++ b/wiki/events/ServerEvents/recipes/event-fields/en.yml @@ -0,0 +1,5 @@ +title: "Event fields" +description: "List of all Event fields for `ServerEvents.recipes`" + +intro: "This is a list of all event fields for `ServerEvents.recipes`. It's possible that not all event fields are listed here, but this list will be updated regularly." +click: "Click on event field to open its class and see information, fields, and methods." \ No newline at end of file diff --git a/wiki/events/ServerEvents/recipes/event-fields/page.kubedoc b/wiki/events/ServerEvents/recipes/event-fields/page.kubedoc new file mode 100644 index 00000000..ad3754b2 --- /dev/null +++ b/wiki/events/ServerEvents/recipes/event-fields/page.kubedoc @@ -0,0 +1,2 @@ +{intro} +{click} \ No newline at end of file diff --git a/wiki/events/ServerEvents/recipes/event-fields/shapeless/page.kubedoc b/wiki/events/ServerEvents/recipes/event-fields/shapeless/page.kubedoc index e69de29b..cf47dfe7 100644 --- a/wiki/events/ServerEvents/recipes/event-fields/shapeless/page.kubedoc +++ b/wiki/events/ServerEvents/recipes/event-fields/shapeless/page.kubedoc @@ -0,0 +1 @@ +Placeholder text \ No newline at end of file diff --git a/wiki/events/ServerEvents/recipes/page.kubedoc b/wiki/events/ServerEvents/recipes/page.kubedoc index 0b9b63af..44c9f9cf 100644 --- a/wiki/events/ServerEvents/recipes/page.kubedoc +++ b/wiki/events/ServerEvents/recipes/page.kubedoc @@ -12,6 +12,7 @@ ServerEvents.recipes(event => { - `[js]handler`: A callback function which gets executed when the event is fired. Return value is discarded. The function is called with the following parameters: + - `[js]event`: Contains [event fields](#event-fields) that (???) # Event Fields @@ -41,7 +42,7 @@ The function is called with the following parameters: - `[js]event.replaceInput`: A function, that replaces inputs of all recipes that match a given filter. - `[js]event.replaceOutput`: A function, that replaces inputs of all recipes that match a given filter. - `[js]event.shaped`: A function, that creates a new shaped crafting recipe. -- `[js]event.shapeless`: A function, that creates a new shapeless crafting recipe. +- [[/event-fields/shapeless|`[js]event.shapeless`]]: A function, that creates a new shapeless crafting recipe. - `[js]event.smelting`: A function, that creates a new Furnace smelting recipe. - `[js]event.smithing`: A function that creates a new Smithing Table smithing recipe. - `[js]event.smithingTrim`: A function that creates a new Smithing Table smithing recipe for applying an Armor Trim. From df95914d1ae43d096ab33f5264b782966a509333 Mon Sep 17 00:00:00 2001 From: KonSola5 <125081901+KonSola5@users.noreply.github.com> Date: Fri, 31 Oct 2025 22:00:58 +0100 Subject: [PATCH 07/15] Will this work? --- wiki/events/ServerEvents/recipes/page.kubedoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wiki/events/ServerEvents/recipes/page.kubedoc b/wiki/events/ServerEvents/recipes/page.kubedoc index 44c9f9cf..d8574808 100644 --- a/wiki/events/ServerEvents/recipes/page.kubedoc +++ b/wiki/events/ServerEvents/recipes/page.kubedoc @@ -42,7 +42,7 @@ The function is called with the following parameters: - `[js]event.replaceInput`: A function, that replaces inputs of all recipes that match a given filter. - `[js]event.replaceOutput`: A function, that replaces inputs of all recipes that match a given filter. - `[js]event.shaped`: A function, that creates a new shaped crafting recipe. -- [[/event-fields/shapeless|`[js]event.shapeless`]]: A function, that creates a new shapeless crafting recipe. +- [[/events/ServerEvents/recipes/event-fields/shapeless|`[js]event.shapeless`]]: A function, that creates a new shapeless crafting recipe. - `[js]event.smelting`: A function, that creates a new Furnace smelting recipe. - `[js]event.smithing`: A function that creates a new Smithing Table smithing recipe. - `[js]event.smithingTrim`: A function that creates a new Smithing Table smithing recipe for applying an Armor Trim. From 7ad2850b124180005da94ff733ffe8215648ea06 Mon Sep 17 00:00:00 2001 From: KonSola5 <125081901+KonSola5@users.noreply.github.com> Date: Fri, 31 Oct 2025 22:04:24 +0100 Subject: [PATCH 08/15] All the links! --- wiki/events/ServerEvents/recipes/page.kubedoc | 66 +++++++++---------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/wiki/events/ServerEvents/recipes/page.kubedoc b/wiki/events/ServerEvents/recipes/page.kubedoc index d8574808..9df4c03e 100644 --- a/wiki/events/ServerEvents/recipes/page.kubedoc +++ b/wiki/events/ServerEvents/recipes/page.kubedoc @@ -17,40 +17,40 @@ The function is called with the following parameters: # Event Fields ## Unique to this event -- `[js]event.addRecipe`: TODO -- `[js]event.addedRecipes`: Contains the list of all added recipes. -- `[js]event.blasting`: Creates a new recipe for the Blast Furnace. -- `[js]event.campfireCooking`: Creates a new recipe for the Campfire. -- `[js]event.containsRecipe`: TODO -- `[js]event.countRecipes`: TODO -- `[js]event.custom`: Creates an arbitrary JSON recipe. -- `[js]event.customFilter`: TODO -- `[js]event.failedCount`: TODO -- `[js]event.findRecipeIds`: TODO -- `[js]event.findRecipes`: TODO -- `[js]event.forEachRecipe`: Executes a provided function for each recipe that matches a given filter. -- `[js]event.getRecipeFunction`: TODO -- `[js]event.getRecipes`: TODO -- `[js]event.itemErrors` ==Setter only==: TODO -- `[js]event.originalRecipes`: TODO -- `[js]event.printAllTypes`: TODO -- `[js]event.printExamples`: A function, that prints example recipes into the game console. -- `[js]event.printTypes`: TODO -- `[js]event.recipeStream`: TODO -- `[js]event.recipes`: A map, that contains recipe types for various mods. Addons may add new recipe types here. -- `[js]event.remove`: A function, that removes all recipes that match a given filter. -- `[js]event.replaceInput`: A function, that replaces inputs of all recipes that match a given filter. -- `[js]event.replaceOutput`: A function, that replaces inputs of all recipes that match a given filter. -- `[js]event.shaped`: A function, that creates a new shaped crafting recipe. +- [[/events/ServerEvents/recipes/event-fields/addRecipe|`[js]event.addRecipe`]]: TODO +- [[/events/ServerEvents/recipes/event-fields/addedRecipes|`[js]event.addedRecipes`]]: Contains the list of all added recipes. +- [[/events/ServerEvents/recipes/event-fields/blasting|`[js]event.blasting`]]: Creates a new recipe for the Blast Furnace. +- [[/events/ServerEvents/recipes/event-fields/campfireCooking|`[js]event.campfireCooking`]]: Creates a new recipe for the Campfire. +- [[/events/ServerEvents/recipes/event-fields/containsRecipe|`[js]event.containsRecipe`]]: TODO +- [[/events/ServerEvents/recipes/event-fields/countRecipes|`[js]event.countRecipes`]]: TODO +- [[/events/ServerEvents/recipes/event-fields/custom|`[js]event.custom`]]: Creates an arbitrary JSON recipe. +- [[/events/ServerEvents/recipes/event-fields/customFilter|`[js]event.customFilter`]]: TODO +- [[/events/ServerEvents/recipes/event-fields/failedCount|`[js]event.failedCount`]]: TODO +- [[/events/ServerEvents/recipes/event-fields/findRecipeIds|`[js]event.findRecipeIds`]]: TODO +- [[/events/ServerEvents/recipes/event-fields/findRecipes|`[js]event.findRecipes`]]: TODO +- [[/events/ServerEvents/recipes/event-fields/forEachRecipe|`[js]event.forEachRecipe`]]: Executes a provided function for each recipe that matches a given filter. +- [[/events/ServerEvents/recipes/event-fields/getRecipeFunction|`[js]event.getRecipeFunction`]]: TODO +- [[/events/ServerEvents/recipes/event-fields/getRecipes|`[js]event.getRecipes`]]: TODO +- [[/events/ServerEvents/recipes/event-fields/itemErrors|`[js]event.itemErrors`]] ==Setter only==: TODO +- [[/events/ServerEvents/recipes/event-fields/originalRecipes|`[js]event.originalRecipes`]]: TODO +- [[/events/ServerEvents/recipes/event-fields/printAllTypes|`[js]event.printAllTypes`]]: TODO +- [[/events/ServerEvents/recipes/event-fields/printExamples|`[js]event.printExamples`]]: A function, that prints example recipes into the game console. +- [[/events/ServerEvents/recipes/event-fields/printTypes|`[js]event.printTypes`]]: TODO +- [[/events/ServerEvents/recipes/event-fields/recipeStream|`[js]event.recipeStream`]]: TODO +- [[/events/ServerEvents/recipes/event-fields/recipes|`[js]event.recipes`]]: A map, that contains recipe types for various mods. Addons may add new recipe types here. +- [[/events/ServerEvents/recipes/event-fields/remove|`[js]event.remove`]]: A function, that removes all recipes that match a given filter. +- [[/events/ServerEvents/recipes/event-fields/replaceInput|`[js]event.replaceInput`]]: A function, that replaces inputs of all recipes that match a given filter. +- [[/events/ServerEvents/recipes/event-fields/replaceOutput|`[js]event.replaceOutput`]]: A function, that replaces inputs of all recipes that match a given filter. +- [[/events/ServerEvents/recipes/event-fields/shaped|`[js]event.shaped`]]: A function, that creates a new shaped crafting recipe. - [[/events/ServerEvents/recipes/event-fields/shapeless|`[js]event.shapeless`]]: A function, that creates a new shapeless crafting recipe. -- `[js]event.smelting`: A function, that creates a new Furnace smelting recipe. -- `[js]event.smithing`: A function that creates a new Smithing Table smithing recipe. -- `[js]event.smithingTrim`: A function that creates a new Smithing Table smithing recipe for applying an Armor Trim. -- `[js]event.smoking`: A function, that creates a new Smoker smoking recipe. -- `[js]event.stage`: TODO -- `[js]event.stonecutting`: A function, that creates a new Stonecutter stonecutting recipe. -- `[js]event.takeId`: TODO -- `[js]event.takenIds`: TODO +- [[/events/ServerEvents/recipes/event-fields/smelting|`[js]event.smelting`]]: A function, that creates a new Furnace smelting recipe. +- [[/events/ServerEvents/recipes/event-fields/smithing|`[js]event.smithing`]]: A function that creates a new Smithing Table smithing recipe. +- [[/events/ServerEvents/recipes/event-fields/smithingTrim|`[js]event.smithingTrim`]]: A function that creates a new Smithing Table smithing recipe for applying an Armor Trim. +- [[/events/ServerEvents/recipes/event-fields/smoking|`[js]event.smoking`]]: A function, that creates a new Smoker smoking recipe. +- [[/events/ServerEvents/recipes/event-fields/stage|`[js]event.stage`]]: TODO +- [[/events/ServerEvents/recipes/event-fields/stonecutting|`[js]event.stonecutting`]]: A function, that creates a new Stonecutter stonecutting recipe. +- [[/events/ServerEvents/recipes/event-fields/takeId|`[js]event.takeId`]]: TODO +- [[/events/ServerEvents/recipes/event-fields/takenIds|`[js]event.takenIds`]]: TODO ## Common to all events - `[js]event.cancel`: Cancels the event with a given exit value. Execution will be stopped **immediately**. - `[js]event.exit`: Stops the event with default exit value. Execution will be stopped **immediately**. From 8fe99e96721d77d06f51b99aeb47f571780d20e6 Mon Sep 17 00:00:00 2001 From: KonSola5 <125081901+KonSola5@users.noreply.github.com> Date: Sat, 1 Nov 2025 10:00:11 +0100 Subject: [PATCH 09/15] Try adding `en.yml` --- wiki/events/ServerEvents/en.yml | 2 ++ wiki/events/ServerEvents/recipes/en.yml | 2 ++ 2 files changed, 4 insertions(+) create mode 100644 wiki/events/ServerEvents/en.yml create mode 100644 wiki/events/ServerEvents/recipes/en.yml diff --git a/wiki/events/ServerEvents/en.yml b/wiki/events/ServerEvents/en.yml new file mode 100644 index 00000000..c003b640 --- /dev/null +++ b/wiki/events/ServerEvents/en.yml @@ -0,0 +1,2 @@ +title: "ServerEvents" +description: "Server Events" \ No newline at end of file diff --git a/wiki/events/ServerEvents/recipes/en.yml b/wiki/events/ServerEvents/recipes/en.yml new file mode 100644 index 00000000..c734c02c --- /dev/null +++ b/wiki/events/ServerEvents/recipes/en.yml @@ -0,0 +1,2 @@ +title: "ServerEvents.recipes" +description: "Server Events Recipes event handler" \ No newline at end of file From 5e1e9c7ad5752270219bcfbbd086a44409d623f2 Mon Sep 17 00:00:00 2001 From: KonSola5 <125081901+KonSola5@users.noreply.github.com> Date: Sat, 1 Nov 2025 10:07:13 +0100 Subject: [PATCH 10/15] Some empty `meta.yml` files change something? --- wiki/events/ServerEvents/meta.yml | 0 wiki/events/meta.yml | 0 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 wiki/events/ServerEvents/meta.yml create mode 100644 wiki/events/meta.yml diff --git a/wiki/events/ServerEvents/meta.yml b/wiki/events/ServerEvents/meta.yml new file mode 100644 index 00000000..e69de29b diff --git a/wiki/events/meta.yml b/wiki/events/meta.yml new file mode 100644 index 00000000..e69de29b From 873ca17d6c2df1af2e39b67aef2a66042ff02a2b Mon Sep 17 00:00:00 2001 From: KonSola5 <125081901+KonSola5@users.noreply.github.com> Date: Sat, 1 Nov 2025 11:41:04 +0100 Subject: [PATCH 11/15] Test of placeholders --- .../event-fields/shapeless/page.kubedoc | 21 +++++++++- wiki/events/en.yml | 38 ++++++++++++++++++- 2 files changed, 57 insertions(+), 2 deletions(-) diff --git a/wiki/events/ServerEvents/recipes/event-fields/shapeless/page.kubedoc b/wiki/events/ServerEvents/recipes/event-fields/shapeless/page.kubedoc index cf47dfe7..b787c05e 100644 --- a/wiki/events/ServerEvents/recipes/event-fields/shapeless/page.kubedoc +++ b/wiki/events/ServerEvents/recipes/event-fields/shapeless/page.kubedoc @@ -1 +1,20 @@ -Placeholder text \ No newline at end of file +The `[js]shapeless` method of `[js]event` creates a new shapeless recipe. + +# Syntax + +```js +ServerEvents.recipes(event => { + event.shapeless(result, ingredients) +}) +``` + +# Parameters +- `result` +An {itemstack} or anything wrappable into an {itemstack}, that is: +{itemstack-wrappable} +- `ingredients`: +An array of {ingredient}s or anything wrappable into {ingredient}s, that is: +{ingredient-item-multi-wrappable} + +# Return value +None ([`undefined`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined)) \ No newline at end of file diff --git a/wiki/events/en.yml b/wiki/events/en.yml index 580ba87f..b8c13133 100644 --- a/wiki/events/en.yml +++ b/wiki/events/en.yml @@ -12,4 +12,40 @@ event-type-client: "Client" client: "Scripts go into the {cl-s} folder. Will be reloaded when you press `F3+T`. Most changes that are per-client (such as resource packs, Painter, and JEI) are client events." folder: "Folder" event: "Event" -has-result: "Has Result" \ No newline at end of file +has-result: "Has Result" + +ingredient: "`[js]Ingredient`" + +ingredient-item-wrappable: | + - A string representing an item (`[js]'minecraft:stone'`), + - A string representing a tag (`[js]'#minecraft:logs'`) + - A string representing a mod (`[js]'@minecraft'`) + - A string representing a creative mod tab (`[js]`), + - A [`[js]RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp) - the resulting `[js]Ingredient` is any item whose ID matches a given regular expression, + - An `[js]ItemStack`, + - An object: `[js]{ item: ItemStack }` where `[js]ItemStack` stands for anything wrappable to an `[js]ItemStack` + +ingredient-item-multi-wrappable: | + - A string representing both item and count (`[js]'2x minecraft:stone'`) + - An object: `[js]{ item: ItemStack, count: number }` where `[js]ItemStack` stands for anything wrappable to an `[js]ItemStack` and `[js]number` stands for any integer number + {ingredient-item-wrapable} + +itemstack: "`[js]ItemStack`" + +# There may be a string wrappable into an item with NBT, but unsure what the syntax for that is. + +itemstack-wrappable: | + - A string representing an item (`[js]'minecraft:stone'`) + - A string representing both item and count (`[js]'2x minecraft:stone'`) + - An object: + ```js + { + item: Item, // or anything wrappable to Item + count: number, // integer number + nbt: CompoundTag, // or anything wrappable to CompoundTag + } + ``` + - A [`[js]RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp) + +item-wrappable: | + - A string representing an item (`[js]'minecraft:stone'`) \ No newline at end of file From c76ba17d5c478225bf6dc6bc2181d110a70ff276 Mon Sep 17 00:00:00 2001 From: KonSola5 <125081901+KonSola5@users.noreply.github.com> Date: Sat, 1 Nov 2025 11:47:01 +0100 Subject: [PATCH 12/15] Move placeholders to `global.yml` (How am I supposed to do this to allow localization?) --- global.yml | 40 +++++++++++++++++++++++++++++++++++++++- wiki/events/en.yml | 38 +------------------------------------- 2 files changed, 40 insertions(+), 38 deletions(-) diff --git a/global.yml b/global.yml index d988b5d1..c4621c0c 100644 --- a/global.yml +++ b/global.yml @@ -16,4 +16,42 @@ se-s: "<#$se-s>" slv-rank: "![[emoji:/other/hall-of-fame/support/slv.png|Silver]]" gld-rank: "![[emoji:/other/hall-of-fame/support/gld.png|Gold]]" -dmd-rank: "![[emoji:/other/hall-of-fame/support/dmd.png|Diamond]]" \ No newline at end of file +dmd-rank: "![[emoji:/other/hall-of-fame/support/dmd.png|Diamond]]" + +# Common terminology (since there is no scoped placeholders) + +ingredient: "`[js]Ingredient`" + +ingredient-item-wrappable: | + - A string representing an item (`[js]'minecraft:stone'`), + - A string representing a tag (`[js]'#minecraft:logs'`) + - A string representing a mod (`[js]'@minecraft'`) + - A string representing a creative mod tab (`[js]`), + - A [`[js]RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp) - the resulting `[js]Ingredient` is any item whose ID matches a given regular expression, + - An `[js]ItemStack`, + - An object: `[js]{ item: ItemStack }` where `[js]ItemStack` stands for anything wrappable to an `[js]ItemStack` + +ingredient-item-multi-wrappable: | + - A string representing both item and count (`[js]'2x minecraft:stone'`) + - An object: `[js]{ item: ItemStack, count: number }` where `[js]ItemStack` stands for anything wrappable to an `[js]ItemStack` and `[js]number` stands for any integer number + {ingredient-item-wrapable} + +itemstack: "`[js]ItemStack`" + +# There may be a string wrappable into an item with NBT, but unsure what the syntax for that is. + +itemstack-wrappable: | + - A string representing an item (`[js]'minecraft:stone'`) + - A string representing both item and count (`[js]'2x minecraft:stone'`) + - An object: + ```js + { + item: Item, // or anything wrappable to Item + count: number, // integer number + nbt: CompoundTag, // or anything wrappable to CompoundTag + } + ``` + - A [`[js]RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp) + +item-wrappable: | + - A string representing an item (`[js]'minecraft:stone'`) \ No newline at end of file diff --git a/wiki/events/en.yml b/wiki/events/en.yml index b8c13133..580ba87f 100644 --- a/wiki/events/en.yml +++ b/wiki/events/en.yml @@ -12,40 +12,4 @@ event-type-client: "Client" client: "Scripts go into the {cl-s} folder. Will be reloaded when you press `F3+T`. Most changes that are per-client (such as resource packs, Painter, and JEI) are client events." folder: "Folder" event: "Event" -has-result: "Has Result" - -ingredient: "`[js]Ingredient`" - -ingredient-item-wrappable: | - - A string representing an item (`[js]'minecraft:stone'`), - - A string representing a tag (`[js]'#minecraft:logs'`) - - A string representing a mod (`[js]'@minecraft'`) - - A string representing a creative mod tab (`[js]`), - - A [`[js]RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp) - the resulting `[js]Ingredient` is any item whose ID matches a given regular expression, - - An `[js]ItemStack`, - - An object: `[js]{ item: ItemStack }` where `[js]ItemStack` stands for anything wrappable to an `[js]ItemStack` - -ingredient-item-multi-wrappable: | - - A string representing both item and count (`[js]'2x minecraft:stone'`) - - An object: `[js]{ item: ItemStack, count: number }` where `[js]ItemStack` stands for anything wrappable to an `[js]ItemStack` and `[js]number` stands for any integer number - {ingredient-item-wrapable} - -itemstack: "`[js]ItemStack`" - -# There may be a string wrappable into an item with NBT, but unsure what the syntax for that is. - -itemstack-wrappable: | - - A string representing an item (`[js]'minecraft:stone'`) - - A string representing both item and count (`[js]'2x minecraft:stone'`) - - An object: - ```js - { - item: Item, // or anything wrappable to Item - count: number, // integer number - nbt: CompoundTag, // or anything wrappable to CompoundTag - } - ``` - - A [`[js]RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp) - -item-wrappable: | - - A string representing an item (`[js]'minecraft:stone'`) \ No newline at end of file +has-result: "Has Result" \ No newline at end of file From 14cfd73afe5fc17cd0428c4d4eccfb4f863b0aea Mon Sep 17 00:00:00 2001 From: KonSola5 <125081901+KonSola5@users.noreply.github.com> Date: Sat, 1 Nov 2025 11:49:12 +0100 Subject: [PATCH 13/15] Sigh --- global.yml | 38 ------------------- .../recipes/event-fields/shapeless/en.yml | 35 +++++++++++++++++ 2 files changed, 35 insertions(+), 38 deletions(-) create mode 100644 wiki/events/ServerEvents/recipes/event-fields/shapeless/en.yml diff --git a/global.yml b/global.yml index c4621c0c..df4c899a 100644 --- a/global.yml +++ b/global.yml @@ -17,41 +17,3 @@ se-s: "<#$se-s>" slv-rank: "![[emoji:/other/hall-of-fame/support/slv.png|Silver]]" gld-rank: "![[emoji:/other/hall-of-fame/support/gld.png|Gold]]" dmd-rank: "![[emoji:/other/hall-of-fame/support/dmd.png|Diamond]]" - -# Common terminology (since there is no scoped placeholders) - -ingredient: "`[js]Ingredient`" - -ingredient-item-wrappable: | - - A string representing an item (`[js]'minecraft:stone'`), - - A string representing a tag (`[js]'#minecraft:logs'`) - - A string representing a mod (`[js]'@minecraft'`) - - A string representing a creative mod tab (`[js]`), - - A [`[js]RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp) - the resulting `[js]Ingredient` is any item whose ID matches a given regular expression, - - An `[js]ItemStack`, - - An object: `[js]{ item: ItemStack }` where `[js]ItemStack` stands for anything wrappable to an `[js]ItemStack` - -ingredient-item-multi-wrappable: | - - A string representing both item and count (`[js]'2x minecraft:stone'`) - - An object: `[js]{ item: ItemStack, count: number }` where `[js]ItemStack` stands for anything wrappable to an `[js]ItemStack` and `[js]number` stands for any integer number - {ingredient-item-wrapable} - -itemstack: "`[js]ItemStack`" - -# There may be a string wrappable into an item with NBT, but unsure what the syntax for that is. - -itemstack-wrappable: | - - A string representing an item (`[js]'minecraft:stone'`) - - A string representing both item and count (`[js]'2x minecraft:stone'`) - - An object: - ```js - { - item: Item, // or anything wrappable to Item - count: number, // integer number - nbt: CompoundTag, // or anything wrappable to CompoundTag - } - ``` - - A [`[js]RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp) - -item-wrappable: | - - A string representing an item (`[js]'minecraft:stone'`) \ No newline at end of file diff --git a/wiki/events/ServerEvents/recipes/event-fields/shapeless/en.yml b/wiki/events/ServerEvents/recipes/event-fields/shapeless/en.yml new file mode 100644 index 00000000..94db491c --- /dev/null +++ b/wiki/events/ServerEvents/recipes/event-fields/shapeless/en.yml @@ -0,0 +1,35 @@ +ingredient: "`[js]Ingredient`" + +ingredient-item-wrappable: | + - A string representing an item (`[js]'minecraft:stone'`), + - A string representing a tag (`[js]'#minecraft:logs'`) + - A string representing a mod (`[js]'@minecraft'`) + - A string representing a creative mod tab (`[js]`), + - A [`[js]RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp) - the resulting `[js]Ingredient` is any item whose ID matches a given regular expression, + - An `[js]ItemStack`, + - An object: `[js]{ item: ItemStack }` where `[js]ItemStack` stands for anything wrappable to an `[js]ItemStack` + +ingredient-item-multi-wrappable: | + - A string representing both item and count (`[js]'2x minecraft:stone'`) + - An object: `[js]{ item: ItemStack, count: number }` where `[js]ItemStack` stands for anything wrappable to an `[js]ItemStack` and `[js]number` stands for any integer number + {ingredient-item-wrapable} + +itemstack: "`[js]ItemStack`" + +# There may be a string wrappable into an item with NBT, but unsure what the syntax for that is. + +itemstack-wrappable: | + - A string representing an item (`[js]'minecraft:stone'`) + - A string representing both item and count (`[js]'2x minecraft:stone'`) + - An object: + ```js + { + item: Item, // or anything wrappable to Item + count: number, // integer number + nbt: CompoundTag, // or anything wrappable to CompoundTag + } + ``` + - A [`[js]RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp) + +item-wrappable: | + - A string representing an item (`[js]'minecraft:stone'`) \ No newline at end of file From 06035e380c6d6a8db4432b381078200ff4942d33 Mon Sep 17 00:00:00 2001 From: KonSola5 <125081901+KonSola5@users.noreply.github.com> Date: Sat, 1 Nov 2025 11:57:45 +0100 Subject: [PATCH 14/15] Hmm... --- wiki/events/ServerEvents/recipes/event-fields/shapeless/en.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wiki/events/ServerEvents/recipes/event-fields/shapeless/en.yml b/wiki/events/ServerEvents/recipes/event-fields/shapeless/en.yml index 94db491c..b99b89f0 100644 --- a/wiki/events/ServerEvents/recipes/event-fields/shapeless/en.yml +++ b/wiki/events/ServerEvents/recipes/event-fields/shapeless/en.yml @@ -1,3 +1,6 @@ +title: "Shapeless" +description: "" + ingredient: "`[js]Ingredient`" ingredient-item-wrappable: | From 4d612e9630ceeaafc1e79624bddc8918f285a266 Mon Sep 17 00:00:00 2001 From: KonSola5 <125081901+KonSola5@users.noreply.github.com> Date: Fri, 5 Dec 2025 19:44:49 +0100 Subject: [PATCH 15/15] WIP changes --- .../recipes/event-fields/shapeless/en.yml | 1 - .../event-fields/shapeless/page.kubedoc | 28 +++++++++++++++---- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/wiki/events/ServerEvents/recipes/event-fields/shapeless/en.yml b/wiki/events/ServerEvents/recipes/event-fields/shapeless/en.yml index b99b89f0..f7fbda12 100644 --- a/wiki/events/ServerEvents/recipes/event-fields/shapeless/en.yml +++ b/wiki/events/ServerEvents/recipes/event-fields/shapeless/en.yml @@ -32,7 +32,6 @@ itemstack-wrappable: | nbt: CompoundTag, // or anything wrappable to CompoundTag } ``` - - A [`[js]RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp) item-wrappable: | - A string representing an item (`[js]'minecraft:stone'`) \ No newline at end of file diff --git a/wiki/events/ServerEvents/recipes/event-fields/shapeless/page.kubedoc b/wiki/events/ServerEvents/recipes/event-fields/shapeless/page.kubedoc index b787c05e..b7714104 100644 --- a/wiki/events/ServerEvents/recipes/event-fields/shapeless/page.kubedoc +++ b/wiki/events/ServerEvents/recipes/event-fields/shapeless/page.kubedoc @@ -9,12 +9,30 @@ ServerEvents.recipes(event => { ``` # Parameters -- `result` +- `result`: An {itemstack} or anything wrappable into an {itemstack}, that is: -{itemstack-wrappable} + - A string representing an item (`[js]'minecraft:stone'`) + - A string representing both item and count (`[js]'2x minecraft:stone'`) + - An object: + ```js + { + item: Item, // or anything wrappable to Item + count: number, // integer number + nbt: CompoundTag, // or anything wrappable to CompoundTag + } + ``` + - `ingredients`: -An array of {ingredient}s or anything wrappable into {ingredient}s, that is: -{ingredient-item-multi-wrappable} +An array of `[js]Ingredient`s or anything wrappable into `[js]Ingredient`s, that is: + - A string representing both item and count (`[js]'2x minecraft:stone'`) + - An object: `[js]{ item: ItemStack, count: number }` where `[js]ItemStack` stands for anything wrappable to an `[js]ItemStack` and `[js]number` stands for any integer number + - A string representing an item (`[js]'minecraft:stone'`), + - A string representing a tag (`[js]'#minecraft:logs'`) + - A string representing a mod (`[js]'@minecraft'`) + - A string representing a creative mod tab (`[js]`), + - A [`[js]RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp) - the resulting `[js]Ingredient` is any item whose ID matches a given regular expression, + - An `[js]ItemStack`, + - An object: `[js]{ item: ItemStack }` where `[js]ItemStack` stands for anything wrappable to an `[js]ItemStack` # Return value -None ([`undefined`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined)) \ No newline at end of file +A new recipe. \ No newline at end of file