#Making a crafting recipe using custom items, modded items and create kubejs

1 messages · Page 1 of 1 (latest)

fossil scaffold
#

I want to make a crafting recipe for Rare Candy, using the spirit orb from paragliders and liquid xp from Mob Grinding Utilities. To start with, I want to make a couple of crafting recipes:

1 orb to 1 dust [custom item i have the art for, but not the script for yet] in a crafting table,
1 orb to 1-3 dusts in the create grind stone, and
1 orb to 6-9 dusts in the crushing wheels.

after that I wish to make "Candy Dough" from dust and liquid xp
in the crafting table, it would be 1 bucket of xp with 4 dust to make 4 dough,
in the mixing basin it would be 1 dust and 1/4th bucket liquid xp, to 1 dough.

after that its just a smoking recipe of 1 dough to 1 rare candy.

unique sigilBOT
#

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

fossil scaffold
#

what I am looking for help with first is if I will need a separate script for everything here, or can I put it all in 1?

austere marlin
#

you can very much make it all in one script

#

well, most of it anyway

#

item registry needs to be done in startup scripts, recipes can be done in startup, but should be done in server scripts

fossil scaffold
#

ok. I will make the items there.

#

Double check my work?

#

I am fairly certain its fine.

austere marlin
#

you should be fine to not specify stacksize if you don't plan to make it anything less than 64

fossil scaffold
#

the names are the same as png names in the assets fo0lder.

#

but i can leave the glow still?

austere marlin
#

i mean, don't see why not

#

unless it errors :p but you'll know pretty quick

fossil scaffold
#

ok, onto recipes. that can go in server, right?

austere marlin
#

yes

#

oh, since you're on 1.16, you need different syntax for events than seen there

fossil scaffold
#

ok, going to start with oh no

austere marlin
#

instead of StartupEvents.registry('item',, you need onEvent('item.registry',

#

for recipes, it's onEvent('recipes',

#

everything after that is the same as you have it currently

fossil scaffold
#

studio is saying that its wrong <.>

#

i can ignore that right?

austere marlin
#

probably

#

might want to double-check that there's no missing syntax though

fossil scaffold
#

how do I do that?

austere marlin
#

if things highlight red, or VS highlights the line red in the overview window

fossil scaffold
#

ok nvm im good.

#

ok, on ingame checking, the items do not exit.

austere marlin
#

might want to check the startup script log then

fossil scaffold
#

I just edited the script already in startup, do i need to change the name?

austere marlin
#

you don't need to

fossil scaffold
vast elkBOT
#

Paste version of startup.txt from @fossil scaffold

austere marlin
#

you rebooted the instance after editing and saving the script, yeah?

fossil scaffold
#

yeah

#

i will try again but ye

#

yeah, still not there

#

these are the texture files

#

^ spirit_dough.png ^spirit_dust.png

austere marlin
#

drop the script then

#

cause something ain't right

fossil scaffold
#

ok

vast elkBOT
#

Paste version of script.js from @fossil scaffold

austere marlin
#

this looks default as hell

fossil scaffold
#

thats not posible

#
    event.create('spirit_dust').glow(true)
    event.create('spirit_dough').glow(true)
  })```
austere marlin
#

either you didn't save it at any point, or you've got the wrong script file

fossil scaffold
#

thats what is in the file

#

i lit just opened it

austere marlin
#

what's your startup script directory look like then

fossil scaffold
austere marlin
#

try opening it with another editor

fossil scaffold
austere marlin
#

upload the script again?

fossil scaffold
vast elkBOT
#

Paste version of script.js from @fossil scaffold

fossil scaffold
#

wtf?

austere marlin
#

see now that's proper

fossil scaffold
#

now it looks fine

austere marlin
#

what happened there? weird

fossil scaffold
#

wtf was that

austere marlin
#

well, give it a try now

fossil scaffold
#

brb gotta go pack my moms lunch cause she is a lazy fucker

fossil scaffold
#

ok, they are finally there

austere marlin
#

good

fossil scaffold
#

well, they exist, but they dont have a localized name

austere marlin
#

you can stick .displayName(string name) on the item's definition in the startup scripts, but that'll display that name for all languages by default, tmk

#

the more proper solution is to make a language file and give the key a translation

fossil scaffold
#

which is fine, as this is a private pack.

#

is this right?

austere marlin
#

those ain't strings, they lack " or ' around them

#

and they've got a trailing comma aswell

fossil scaffold
#

ok

#

ok, i need some syntax help with this script

austere marlin
#

encase what you already have in the recipe event block in do event.shaped()

#

uh, wait

#

encase the bottom part in event.shaped(), after the array containing paraglider:spirit_orb

#
event.shapeless('kubejs:spirit_dust', [
  'paraglider:spirit_orb'
])```
as for the upper one, this should work
#

problem is it can't really know the recipe type from just item or map definitions :p

fossil scaffold
austere marlin
#

the "grid" of the shaped should be in [], and not {}, and there shouldn't be a second layer of [] ontop of it and the ingredient map

#

it also needs to sit in a recipe event block

#

otherwise, where are you gonna get the recipe handler? and have it run at the recipe registry time?

fossil scaffold
#

so before line one put ServerEvents.recipes(event => {

austere marlin
#

onEvent('recipes', event => {

#

if you were on 1.19, you'd use ServerEvents.recipes, but you're not

fossil scaffold
#

where can i find the wiki for 1.16.5?

austere marlin
#

the source code

#

uh, looking things up here may be your best bet honestly

#

filtering by forum tags for your version should help, probably

#

might also be able to learn a thing or two from other modpacks' scripts

fossil scaffold
#

once this recipe and a smoker/campfire recipe is done i wont need it. i have all the scripts i need for the create addon already

austere marlin
#

drop the script

fossil scaffold
austere marlin
#

as file is preferrable, usually

fossil scaffold
vast elkBOT
#

Paste version of script.js from @fossil scaffold

austere marlin
#

well, that's odd :v

#

doin that same thing it did before, for some incomprehensible reason

#

what are you doing to save the file?

fossil scaffold
#

saving the file while the game is open

austere marlin
#

right, but how is it being saved?

#

hotkey? button in the app?

#

and what hotkey or button?

fossil scaffold
#

file save

vast elkBOT
#

Paste version of script.js from @fossil scaffold

fossil scaffold
#

no idea why thats happening. but i am going to file -> save

austere marlin
#

could be worth trying CTRL+S instead for a while

#

try /reloading from here now that it seems to have saved properly

#

see if throws a new error

fossil scaffold
#

it only saved right after closing the game

#

ok, onto the cooking of the dough

#

Do you think you could give me a furnace event setup?

austere marlin
#

yes

#

event.smelting(ItemStackJS output, ItemStackJS input)

#
//example
event.smelting('minecraft:dirt', 'minecraft:grass_block')```
#

i believe you should also be able to use .cookingTime(int time) to set the time it takes to process in ticks

#

for campfire, it should be pretty similar, just event.campfireCooking() instead

#

also, if you want a fancy recipeid that isn't something kjs:recipe_23368239, you can stick .id(string id) on the end

fossil scaffold
#

im going to just do a furnace event.

austere marlin
#

if you don't put a : in the string, it'll use the kubejs namespace, but you can put a custom one if you want to

fossil scaffold
#

the output isnt trainer food.

austere marlin
#
event.smelting('minecraft:dirt', 'minecraft:grass_block').id('pixelmoncustom:smelting/kill_grass')```
fossil scaffold
#

event.smelting('pixelmon:rare_candy', 'kubejs:spirit_dough').cookingTime('10'

#

?

#

where 10 is the number of seconds

austere marlin
#

if you want it to be 10 seconds, you need to do 20 times that

#

but 10 seconds is the default time, so you can omit that element completely

fossil scaffold
#

ok.

austere marlin
#

since it's just a number, you don't need to make it a string

#

int is a whole number from 0 to 2147483647

fossil scaffold
#

ok. all good then

austere marlin
#

if this weren't JS, where strings can be automatically converted to numbers, you'd get an error

fossil scaffold
austere marlin
#

uh

#

hm

#

i've not used full Visual Studio, just use VSCode myself, so maybe it's different or not a thing there?

fossil scaffold
#

just going to save when the game is closed.

austere marlin
#

that seems weird as hell, but it's a possibility, i guess

fossil scaffold
#

ok, now onto the createjs stuff

#

which i will do tomorrow as I am quite tired now. I will leave this thread open incase I still need help.

fossil scaffold
#

would you happen to know if the documentation on the create kubejs curseforge page is still the same for the 1.16.5 version? also how to specify only 1/4th a bucket of liquid?

#

just asking atm, cant start working on it yet.

austere marlin
#

it should be

#

as for specifying fluid, Fluid.of('minecraft:water', 250) will specify 250mB of Water

fossil scaffold
#

thanks

fossil scaffold
#

ok, fixed the saving thing.program was in safe mode. i trying out my milling recipe but i am getting this error

#

here comes the file as it is now

vast elkBOT
#

Paste version of script.js from @fossil scaffold

fossil scaffold
#

im trying to get 3 spirit dust out of one orb using the mill.

austere marlin
#

do either 3x kubejs:spirit_dust, or Item.of('kubejs:spirit_dust' 3)

fossil scaffold
#

ok, I see where i went wrong, thanks

austere marlin
#

[3] is indexing the fourth character in the string, and generally the letter e is not a valid item

fossil scaffold
#

thanks

#

ok, that worked, but now i need jei integration for kubejs create recipes lmao

austere marlin
#

if you've got JEI and Create, they should show up

#

it'll just be using Create's builtin JEI support

fossil scaffold
#

it must be only after a full reboot

#

this is 1.16.5, again.

austere marlin
#

it should be working with just a reload

fossil scaffold
#
  '6x kubejs:spirit_dust',
  Item.of('3x kubejs:spirit_dust').withChance(0.5)
]
  'paraglider:spirit_orb'```
austere marlin
#

well it ain't loading, and there's a reason

fossil scaffold
#

that look right for gettin 6 dust with a chance of 3 extra?

austere marlin
#

you got it the wrong way around

fossil scaffold
#

oh man, your right

austere marlin
#

stick the spirit dust definitions in the array, and the orb where they were before

fossil scaffold
#

that look right now?

austere marlin
#

yeah, that's more like it

fossil scaffold
#

its only giving me 3...

austere marlin
#

what does it look like JEI?

fossil scaffold
#

the 6x part isnt working

#

it doesnt

#

oh it does now

#

1 orb to 3 dust guarenteed

#

not even the chance is showing up

austere marlin
#

try changing Item.of('3x kubejs:spirit_dust') to Item.of('kubejs:spirit_dust', 3)

fossil scaffold
austere marlin
#

drop the script

fossil scaffold
#

nvm i got it. phantom 8 showed up where it didnt belong

#

lets reload and try again

vast elkBOT
#

Paste version of script.js from @fossil scaffold

austere marlin
#
event.recipes.createCrushing([
    '6x kubejs:spirit_dust',
    Item.of('kubejs:spirit_dust', 3).withChance(0.5)
],
'paraglider:spirit_orb'
)```
#

that should work

fossil scaffold
#

that did it. now, all i have to do its the mixing and i can build my rare candy farm. lmao

vast elkBOT
#

Paste version of script.js from @fossil scaffold

austere marlin
#

looks fine to me

fossil scaffold
#

oh, because im stupid

#

im not trying to make rare candy

#

im making the dough

#

thats everything! thank you so much for your help!