#"Item with ID minecraft: does not exist!" error

18 messages · Page 1 of 1 (latest)

blissful swallow
#

Hi everyone! This is probably me making a stupid mistake somewhere, but I've been trying for like an hour and can't figure it out. I've got these two scripts in my folder, but when I try to load a world it gives me this error for items in COYCATS_FUNCTIONAL with a tag in the base value:

[14:51:30] [ERROR] ! server_scripts:recipes/shapeless_crafting.js#15: Error in 'ServerEvents.recipes': Failed to read item stack from #genesis:stone_pressure_plates: Item with ID minecraft: does not exist!

The thing that puzzles me in this example is that 'minecraft' shouldn't be anywhere in the ID of the recipe it's getting stuck on, so I have no clue what I'm doing wrong. Any help explaining this error would be most appreciated!

sacred echoBOT
#

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

novel dawn
#

Show the shapeless_crafting.js script

blissful swallow
#

Working on it, one sec

novel dawn
#

This error occurs if the ID you are trying to pass is invalid (and probably is an empty string here), hooray for KubeJS for making this a hard error!

blissful swallow
dusk sandBOT
#

Paste version of shapeless_crafting.js, copycats_functional.js, server.log from @blissful swallow

novel dawn
#

Hmm, do you really need the recipe inputs to be defined in global in startup scripts?

#

I see an issue:
In your code, you have:
Item.of(base, 4)
but sometimes base starts with a # which is never a valid item ID.

{
    block: 'trapdoor',
    base: '#minecraft:wooden_trapdoors',
    count: 1
}
#

So it becomes:

Item.of('#minecraft:wooden_trapdoors', 4)

Which is not a valid item ID

#

It is a valid ingredient syntax though, and you want your recipe inputs as ingredients

#
ServerEvents.recipes(event => {
  // RECIPE FUNCTION
  const add = (recipeId, inputs, output, count) => {
    event.shapeless(Item.of(output, count), inputs).id(`genesis:${recipeId}_shapeless`)
  }

  // BULK RECIPE CHANGES
  global.COPYCATS_FUNCTIONAL.forEach(entry => {
    const { block, base, count } = entry
    console.log('BLOCK: ' + block + ' || BASE/COUNT: Item.of(' + base + ', ' + count + ')')
    if (count == 1) {
      add(`copycat_${block}`, [base, 'copycats:copycat_block'], `copycats:copycat_${block}`, 1)
    } else if (count == 4) {
-     add(`copycat_${block}`, [Item.of(base, 4), 'copycats:copycat_block'], `copycats:copycat_${block}`, 4)
+     add(`copycat_${block}`, [SizedIngredient.of(base, 4), 'copycats:copycat_block'], `copycats:copycat_${block}`, 4)
    }
  })
})
#

Change Item.of(base, 4) to SizedIngredient.of(base, 4)

#

Also, you can simplify your script:

ServerEvents.recipes(event => {
  // RECIPE FUNCTION
  const add = (recipeId, inputs, output, count) => {
    event.shapeless(Item.of(output, count), inputs).id(`genesis:${recipeId}_shapeless`)
  }

  // BULK RECIPE CHANGES
  global.COPYCATS_FUNCTIONAL.forEach(entry => {
    const { block, base, count } = entry
    console.log('BLOCK: ' + block + ' || BASE/COUNT: Item.of(' + base + ', ' + count + ')')
    add(`copycat_${block}`, [SizedIngredient.of(base, count), 'copycats:copycat_block'], `copycats:copycat_${block}`, count)
  })
})
blissful swallow
blissful swallow
# novel dawn Change `Item.of(base, 4)` to `SizedIngredient.of(base, 4)`

Ahhh, that makes sense... I could have sworn I'd used tags in Item.of() before, but I'm probably misremembering and didn't know you could do SizedIngredient instead of just Ingredient. I'm assuming that would require an item ID or tag to work, though, not something like a regex for a recipe?

blissful swallow
blissful swallow