#Item list with a common characteristic

20 messages · Page 1 of 1 (latest)

honest tree
#

There is possibility to obtain all item that have, for example, burnTime == 150?

marsh sageBOT
#

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

ocean thorn
#

You can get all items with Ingredient.all.stacks and then you can Loop over it and get the burn time for Each Item.

honest tree
#

Ok, I'll try.

honest tree
#
PlayerEvents.loggedIn(event => {
    Ingredient.all.stacks.forEach(item => {
        if(Item.of(item).getBurnTime == 150) {
            console.log(item)
        }
    })
})
#

It doesn't work...

near sand
#

??neversay

acoustic plankBOT
# near sand ??neversay

Never say 'it crashed', 'it errored', or 'it didn't work' without providing the full error message/crash report/log files!

near sand
#

also, I said it in another thread

#

it's either getBurnTime() or burnTime

honest tree
#

Ok, I'll try.

#

If I use getBurnTime(), kubejs say.

#

[14:07:34] [ERROR] ! #93: Error occurred while handling event 'PlayerEvents.loggedIn': Can't find method net.minecraftforge.common.extensions.IForgeItemStack.getBurnTime(). (server_scripts:itemstage.js#93)

#

And the second one is not auto-completed by probejs

#

If I use burnTime there aren't errors, but kubejs "write" nothing in console...

near sand
#
const $RecipeType = Java.loadClass('net.minecraft.world.item.crafting.RecipeType')
const smelting = $RecipeType.SMELTING

Ingredient.all.stacks.forEach(i => {
    if(i.getBurnTime(smelting) == 150) console.log(i)
})
honest tree
#

Ok, thanks.

#
Ingredient.all.stacks.forEach(item => {
        if(item.getBurnTime(smelting) == 150) console.log(item)
})```
near sand
honest tree
#

It doesn't print...