KubeJS

KubeJS

69M Downloads

[Questions] (custom item and foodbuilder)

Sokas opened this issue · 3 comments

commented

Hi,

I have some questions:

  1. I keep getting "not a valid result" when using a recipe with a custom item I created with KubeJS.
    Example:
    in startup_scripts: event.create('cardboard').displayName('Cardboard')
    in server_scripts: event.shaped('cardboard', ['xxx','xxx','xxx'], {x: 'minecraft:paper' })
    If I put a namespace before, like "mokas:cardboard", the texture stops working. How do I fix it? I can't have : in the filename.

  2. Could you please put an example in the documentation about the foodBuilder? I don't know how to build it.

And I found an error in the recipeeventjs docs:
The number of carrots in lines 41 and 43 do not match.

Thanks in advance!

commented
  1. when creating items, they're created in the kubejs namespace, but recipes use the minecraft namespace by default (tl;dr - use kubejs:cardboard for the output of the recipe).
    also, if you wanna use a custom namespace, you can just use mokas:cardboard and then move your texture to kubejs/assets/mokas/... instead of kubejs/assets/kubejs/..., that should just work
  2. Also I'll add an example for food items down the line, for now I think Seaopolis has some nice example foods you could work with though
commented

Hi @MaxNeedsSnacks,
I could not find anything regarding food and Seaopolis, could you please help?

Regards!

commented

Seaopolis is a modpack that has a couple of custom items, including custom foods ^^

Here's an example in the form of their seabucks coffee that should show off some of the features of food items:

event.create('seabuck_coffee').food(food => {
  food.hunger(2).saturation(2).effect('minecraft:speed', 100, 9, 1.0).eaten(e => {
    console.log(e.player + " ate " + e.item);
    e.server.runCommandSilent(`give ${e.player} minecraft:glass_bottle`)
  })
}).displayName('Seabucks Coffee').maxStackSize(8)