#Predicate based on burn time

25 messages · Page 1 of 1 (latest)

narrow fiber
#

There is possibility to create a js predicate to obtain the item burn time? A java method requires Predicate<IItemStack> in a method and I don't know how can I obtain this with KubeJS.

ruby kelpBOT
#

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

deep pewter
#

An Itemstack is Item.of("mod:id") though idk If this is what you want.

#

Also do you have some Sort of Code already?

arctic yewBOT
#

🗒️**Send the code!**🗒️
You may have an issue with a KubeJS script and you explain it to the best of your ability yet without the actual code in question we have very little to go off of in trying to assist you.

marble abyss
deep pewter
#

Question

narrow fiber
#
public static Restriction restrict (Predicate<IItemStack> predicate, String... requiredStages) {
        
        return restrictInternal(stack -> predicate.test(new MCItemStack(stack)), requiredStages);
    }
#

Like this.

marble abyss
#

they should be wrapped automatically

#

so you just need to give it a Item.of(...) iirc

narrow fiber
#

Ok, I'll try.

#
console.log(Item.of('anything').getBurnTime == 150)
#

This is the code.

marble abyss
#
console.log(Item.of('anything').burnTime == 150)
// or
console.log(Item.of('anything').getBurnTime() == 150)
narrow fiber
#

But how can I check every item in minecraft then take every item that as burnTime == 150?

#

Excuse the first

#

No no, the second

marble abyss
narrow fiber
#

Therefore?

marble abyss
#

both should work

narrow fiber
#

I'd like to obtain all items that have burnTime == 150.

narrow fiber
#

Any idea?