#Add Items to creative tab after specific item

45 messages · Page 1 of 1 (latest)

lusty fjord
#

i want to move all of the woods/logs/planks/etc. to the building_blocks creative tab after stack 436. id prefer using regex to get them all there but it didnt order them correctly, would something like the image be feasible?

amber ferryBOT
#

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

lusty fjord
#

disregard that remove from other tabs, ill just disable the other tabs i dont need

scenic idol
#

It is definitely feasible to use regex with those patterns

#

I’m not sure what you mean by "after stack 436" part though

lusty fjord
#

yeah dont worry its e.addafter()

#

i figured that out haha

scenic idol
#

I’m just not sure what the intent is, did you mean that you want to limit the items within a creative tab and move them to a separate one?

lusty fjord
#

oh no, i just counted the existing stacks and wanted the items displayed in the category after the counted ones

scenic idol
#

Ahh okay

lusty fjord
#
  e.add(Ingredient.of(/.*(baobab|silver_birch|blackwood|cobalt|dead|eucalyptus|larch|magnolia|mauve|palm|pine|socotra|ancient_oak)_(log|wood|planks|stairs|slab|fence|door|trapdoor|pressure_plate|button).*/).stacks.toArray())
})```
#

i tried this before

#

(i now know i can just use e.addafter to specify where these blocks should go)

#

but that regex sadly didnt work

scenic idol
#

Dear god that regex scares me

lusty fjord
#

hahahahahahaha

#

yeah because it comes from a person that isnt very talented at regex lmao

#

still kinda? worked for other stuff lol

scenic idol
#

Pro tip for regex:
You don’t need a 1 size fits all regex filter.

#

Separate regex filters are also possible, and may save you some headache

lusty fjord
#

wait theres a new wiki??

scenic idol
#

That’s not a new wiki, that’s my mod

lusty fjord
#

ohh lol

scenic idol
#

It seems my mod hasn’t been run on main KJS 1.20 in a long time, so it doesn’t have the latest docs

#

Let me remote connect to my pc and update them real quick

lusty fjord
#

i didnt know it was a 1.20 feature of kjs tbh (in hindsight its really obvious tho lol)

scenic idol
#

It’s currently building, I updated KJS and fabric versions so that it has the latest docs for both

#

There we go!

lusty fjord
#

nice!

scenic idol
#

Okay so this is the methods your using

#

All of them are ItemStacks, so if I can find an example where somebody is regexing wood types for recipes, it should apply here

lusty fjord
#

thatd be amazing

#

im looking through there and theres some pretty cool stuff like setDisplayName and setIcon

scenic idol
violet minnowBOT
#

[➤](#1206533616394571826 message)

const unfinishedFurnitureWoods = ['minecraft', 'biomesoplenty']
ServerEvents.recipes(e => {
    //Create Unfinished Wood Furniture Recipes - We could also create objects for each one but that would be kind of extra considering how simplistic these frames are.
    for (let mod in unfinishedFurnitureWoods) {
        for (let wood in global.woodTypes[mod]) {
            let inter = `${mod}:${wood}_planks`
            e.recipes.createSequencedAssembly([
                Item.of(`kubejs:unfinished_${wood}_furniture`).withChance(95.0), Item.of('gtceu:wood_dust')],
            inter, [
                e.recipes.createCutting(inter, inter),
                e.recipes.createDeploying(inter, [inter, `kubejs:${wood}_timber`]),
                e.recipes.createDeploying(inter, [inter, screw]),
                e.recipes.createDeploying(inter, [inter, screwdriver])
            ]).transitionalItem(inter).loops(4)
        }
    }```
Far more recipes are below this, but all of that's working. It's just this recipe not working. No errors in log. But the recipes I'm trying to construct just don't exist.
scenic idol
violet minnowBOT
lusty fjord
#

ooo

#

an additional problem i had was that the stacks werent ordered as the (log|wood|planks|stairs|slab|fence|door|trapdoor|pressure_plate|button) in the file, can i get it to do that?

scenic idol
#

Possibly by getting the list of items first, and then combine them into one list, and then sort them by that criteria

lusty fjord
#

oh god that sounds complicated for my tired brain lmao

#

i might have to tackle that tmrw