#Using NBT in ServerEvents.recipes event.custom() in ingredients and results

27 messages · Page 1 of 1 (latest)

scarlet kestrel
#

As the title says, im trying to figure out how to use NBT data or another type of data in both the ingredient and results. an example being the following:

        event.custom({
            type: "create:milling",
            ingredients: [{ item: "kubejs:basalt_remnants" }],
            processing_time: 200.0,
            results: [
                {
                    id: "kubejs:basalt_shard", nbt:{"stage1"}
                },
            ],
        });

        event.custom({
            type: "create:milling",
            ingredients: [{ id: "kubejs:basalt_shard", nbt:{"stage1"} }],
            processing_time: 200.0,
            results: [
                {
                    id: "kubejs:basalt_shard", nbt:{"stage2"}
                },
            ],
        });

        event.custom({
            type: "create:milling",
            ingredients: [{ id: "kubejs:basalt_shard", nbt:{"stage2"} }],
            processing_time: 200.0,
            results: [
                {
                    id: "minecraft:gold_block"
                },
            ],
        });

if theres another method like tags or somthing else thats easier, that works too

lime merlinBOT
#

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

scarlet kestrel
#

Oh furthermore if there's just another method entirely to do it that would work too. This is just a very poor example that's builds of what works

midnight acorn
#

I've been trying to do something similar myself. Here's what I've found so far:

I would recommend taking a look at Create's recipes:
https://github.com/Creators-of-Create/Create/tree/mc1.21.1/dev/src/generated/resources/data/create/recipe
Particularly for glowstone, since that uses data for potions:
https://github.com/Creators-of-Create/Create/blob/mc1.21.1/dev/src/generated/resources/data/create/recipe/filling/glowstone.json

The main thing to know is that it's not "nbt", it's called "components" now. I'm not sure what the rules are for components, it seems they might have to be registered and you can't just add them directly like in JSON. When I did, there was an error in the log about how the component couldn't be found. I'm not yet sure how to do that.

However, be aware that at the moment, as of Create 6.0.4, "components" is ignored for items and only works for fluids: https://github.com/Creators-of-Create/Create/issues/7962

This should be fixed in the next release, according to that issue.

GitHub

[Forge Mod] Building Tools and Aesthetic Technology - Creators-of-Create/Create

GitHub

[Forge Mod] Building Tools and Aesthetic Technology - Creators-of-Create/Create

GitHub

Description This custom spout recipe (arrow + fire resistance potion --> fire resistance tipped arrow) used to work perfectly with 6.0.2 But no longer does in 6.0.3 (it ignores the component and...

scarlet kestrel
#

Alright, thanks. I still think there's a way I could force this, due to create arcane engineerings frame of patience kinda having a script that does what I want but holy I cannot read and/or understand it lol

#

Also unsure if the same stuff exist in this version of kube js

#

Oh yea, since you are looking for something similar id recommend you go check it out @midnight acorn

#

Think I can actually grab the file form their GitHub

copper gateBOT
#

Paste version of patienceFragment.txt from @scarlet kestrel

scarlet kestrel
#

Why is it in txt instead of js? Oh well

midnight acorn
#

So I took a look but I'm only seeing 1.18.2 for Create Arcane Engineering, and the snippet you provided looks like the addon syntax that existed up to 1.20.1.
Unfortunately with the changes to data in 1.21.1, we're in a transitionary phase where a lot of stuff isn't up to date yet. That addon, for example, hasn't been updated so you have to use event.custom to essentially make a datapack recipe. With Create's bug about not recognizing the components data, I'm afraid the only way to do this is either go back to 1.20.1 or wait until Create 6.0.5 is released.

#

I refactored the fragment so that it was more understandable. It basically just randomly decides which stage gets processed which way. But this fragment will only work in 1.20.1 and below.

copper gateBOT
#

Paste version of patienceFragment.js from @midnight acorn

scarlet kestrel
#

The most obvious for my situation is just to make a slightly different item and/or use tags but I'll keep attempting a different solution than that as it becomes a decent amount of needed data

scarlet kestrel
#

hm, well actually how would i even edit/add/remove components/nbt if im just making any item using vanilla stuff? , like lets say you take some red wool, add gold to it, it becomes yellow wool with stage 1 put it in a furnace and its a yellow wool with stage 2, stone cut it into a yellow wool with stage3 and craft it with a diamond to get green wool

#

feel like if we can immitate that, theres someway to brute force this

#

im just not seeing a method on the wiki on how to even change anything about nbt/componetns at all

#

worst comes to worse, you can always just make an item that fakes being the same item, ie having X_1, X_2 and so on

scarlet kestrel
#

Bump, just wanna make sure this is either a feature that is either 1. On create for not being implemented or 2, isn't fully implemented into this version of kubejs yet

#

Either way it's just me waiting but just wanna make sure I understand

#

actually, theres a section on each item called "Lore" . i might try to look around and see if i can edit that

scarlet kestrel
#

well you can change the lore, just only on startup which does NOT help me :D

scarlet kestrel
#

yea think im at the point where i dont think this is possible with kubejs alone? doesnt seem like components are implemented yet in general so ill keep as open untill i get comformation thats its either impossible atm, or possible im just doing it incorrectly

scarlet kestrel
#

Le bump

vivid nest