#Mass mystical agriculture seeds & Insolator
11 messages · Page 1 of 1 (latest)
Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!
you can call "let". the following should be about what you need
let mysticalInsolate = (material, chance) => {
let seed = `mysticalagriculture:${material}_seeds`
let essence = `mysticalagriculture:${material}_essence`
event.custom({
"type": "thermal:insolator",
"ingredient": {
"item": seed
},
"result": [
{
"item": essence,
"chance": chance
},
{
"item": seed
},
{
"item": "mysticalagriculture:fertilized_essence",
"chance": 0.1
}
],
"experience": 0.15
})
}
mysticalInsolate("deepslate", 0.8)
mysticalInsolate("diamond", 0.8)
I think this should work based on my understanding of mystical agriculture. This example should always give the seed back, as well as an essence sometimes at the chance you specify.
Okay
Ill give it a try
It's not that you can call "let", it's that you can assign a function to a variable.
Functions in JS are just objects with a property of being callable
In fact, all of these are valid ways you can declare a function:
// Function statement
function mysticalInsolate(material, chance) {
// ...
}
// Function expression
let mysticalInsolate = function (material, chance) {
// ...
}
// Arrow function expression
let mysticalInsolate = (material, chance) => {
// ...
}
It gave an error.
Ill post what i have in a bit
ServerEvents.recipes(event =>
{
let mysticalInsolate = (material, chance) =>
{
let seed = 'mysticalagriculture:${material}_seeds'
let essence = 'mysticalagriculture:${material}_essence'
event.custom(
{
"type": "thermal:insolator",
"ingredient":
{
"item": seed
},
"result":
[
{
"item": essence,
"chance": chance
},
{
"item": seed
},
{
"item": "mysticalagriculture:fertilized_essence",
"chance": 0.1
}
],
"experience": 0.15
}
)
}
mysticalInsolate("dragon_egg", 0.8)
})
I found the error, I used ' instead of `