#Farmers Delight adding recipes

46 messages · Page 1 of 1 (latest)

idle linden
#

On the KubeJS Wiki for 1.18 there is farmers delight listed as a mod you can work with, however there is no page explaining anything. in the 1.16 version of the wiki, there are some example skripts, but well, its a different version so i dont know if it even is still possible or the right way. Of course, i tried it, but well, the recipe just wont show up (or work)... Heres the code i used:

`import mods.farmersdelight.CuttingBoard; //Better be safe than sorry

recipetype:farmersdelight:cutting.addRecipe("cutting_board_test", item:minecraft:gravel, [item:minecraft:flint], item:minecraft:string, "minecraft:block.gravel.break");`

Any1 has an idea on what i have to do in order to make it work?

past quarryBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

gray oak
#

You can use event.custom({json}) for Farmer's Delight recipes, as they're made with json recipes

idle linden
#

so sth like this?

event.custom({ "type": "farmersdelight:cutting", "ingredients": [ { "item": "kubejs:spider_leg" } ], "result": { "item": "kubejs:raw_spider_leg", "count": 1, }, "cuttingtime": 200 })

cunning thicketBOT
#

You can write your code in a codeblock by typing it between the codeblock delimiters:

```js :arrow_left:

onEvent('recipes', e => {
e.smelting('minecraft:glass', '#forge:sand').xp(.1)
})

``` :arrow_left:

As an example, :arrow_up: will look like this:

onEvent('recipes', e => {
  e.smelting('minecraft:glass', '#forge:sand').xp(.1)
})
idle linden
#

but for cutting

gray oak
#

Looks right to me, yeah

signal dragon
gray oak
#

Not for 1.18 I don't think

signal dragon
#

yeah you are right

#

so just use event.custom

gray oak
#

This is why thread tags exist 😛

idle linden
idle linden
gray oak
#

Yes, the json looks good

idle linden
#

alright imma try

#

Theres an Error:
Error: Error while running scripts: farmers_delight_recipe.zs:14.0: ; expected
So i just need to add a semicolon to the end?

gray oak
#

No

#

Show me your script

#

Inside a codeblock

#

Unless you don't have anything else?

idle linden
#

its all

#
event.custom({
    "type": "farmersdelight:cutting",
    "ingredients": [
      {
        "item": "kubejs:spider_leg"
      }
    ],
    "result": {
      "item": "kubejs:raw_spider_leg",
      "count": 1,
    },
    "cuttingtime": 200
  })```
gray oak
#

You have to put it in a recipe event

idle linden
#

ahh shit

#

im schtepid

gray oak
#

Semicolons don't really matter in JavaScript

#

They just make it look better

idle linden
#

soo when doing that that:

onEvent('recipes', event => 
                       {
                        event.custom(
                                     {
                                      "type": "farmersdelight:cutting",
                                      "ingredients": [
                                                      {
                                                       "item": "kubejs:spider_leg"
                                                      }
                                                     ],
                                      "result": {
                                                 "item": "kubejs:raw_spider_leg",
                                                 "count": 1,
                                                },
                                      "cuttingtime": 200
                                     }
                                    )
                       }
        )```
the following happens:
cunning thicketBOT
#

You can find your KubeJS server log here. You should send it if asked, as it contains helpful information: minecraft/logs/kubejs/server.log
If you are on 1.18 or below it will be called server.txt.

idle linden
cunning thicketBOT
#

Paste version of server.txt from @idle linden

gray oak
#

com.google.gson.JsonSyntaxException: Missing tool, expected to find a JsonObject

idle linden
#

what does that mean?

#

😅 😬

gray oak
#

You forgot the tool

signal dragon
gray oak
#

I got it Mango heh

idle linden
#

im so sorry 😓 thank you

gray oak
#

No problem!

idle linden
#

(btw im sorry bout the beginning question. i used the forking wrong wiki for it- i dont know why but i opened the crafttweaker wiki and didnt realise it)

gray oak
#

Just know you won't be importing anything in JS 🙂

idle linden
#

ehehe 😅 well wont be doing the same mistake twice (hopefully xD)

gray oak
#

I believe in you

idle linden
#

for future generations (lmao):
The following script works perfectly fine:

onEvent('recipes', event => {
         event.custom(
                      {
            "type": "farmersdelight:cutting",
            "ingredients": [
                            {
                     "item": "kubejs:spider_leg"
                    }
                       ],
            "result": [
                   {
                    "item": "kubejs:raw_spider_leg"
                   }
                  ],
            "tool": {
                 "tag": "forge:tools/knives"
                }
                      }
                     )

})```

Thanks for the help