#how to require specific nbt for recipe input?

22 messages · Page 1 of 1 (latest)

open phoenix
#

is it even possible? i tested with a minimal example with a new clean instance without other mods or kjs addons and it doesn't work, it registers the recipe without error but it doesn't require any nbt value on the input.
code```javascript
ServerEvents.recipes(event => {
event.shapeless("minecraft:diamond",[Item.of("minecraft:filled_map",{map:0})]);
})

this snippet should make the first ever map generated in a world be craftable into diamonds but any filled map is
ancient forgeBOT
#

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

gaunt drum
#

use this:

ServerEvents.recipes(event => {
    event.shapeless(':diamond', [Item.of('filled_map', '{map: 0}').strongNBT()])
})
open phoenix
#

oh

#

thanks

open phoenix
#

does it only match exactly?

#

how do i do it contains a field and it has this value?

#

found out how .weakNBT()

undone merlin
#

I had a question about this as well, but was wanting to know how to use it for the output and specify the quantity

open phoenix
#

should just work if you do Item.of(id,nbt) instead of id

undone merlin
#

Is there a way to set the quantity of that for the output?
Like, if you wanted 9 of them instead of just 1

finite merlin
#

you want item, nbt and the count?

#

or just item and count?

undone merlin
#

All three

finite merlin
#

this is the signature

undone merlin
#

Ah many thanks.
How did you get that syntax?

#

I have just been using notepad++

finite merlin
#

ProbeJS

bright juncoBOT
#

ProbeJS is an addon mod for KubeJS that generates typings files for VSCode, allowing VSCode to offer autocompletions for a ton of things!

Mod by @frigid onyx

#

If you're working with KubeJS scripts, config files, or similar things, we generally recommend using an actual IDE rather than just Notepad++ and its various siblings.
In a lot of cases, it can help you find errors in your code faster and also gives you neat features like syntax highlighting, automatic formatting, etc!
We recommend Visual Studio Code, since it's lightweight(-ish) and works very well with JavaScript files out-of-the-box.