#Add Items to creative tab after specific item
45 messages · Page 1 of 1 (latest)
Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!
disregard that remove from other tabs, ill just disable the other tabs i dont need
It is definitely feasible to use regex with those patterns
I’m not sure what you mean by "after stack 436" part though
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?
oh no, i just counted the existing stacks and wanted the items displayed in the category after the counted ones
Ahh okay
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
Dear god that regex scares me
hahahahahahaha
yeah because it comes from a person that isnt very talented at regex lmao
still kinda? worked for other stuff lol
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
Give me a sec to check the documentation for the event
https://hunter19823.github.io/kubejsoffline/1.20.1/fabric#?any=ModifyCreativeTab
wait theres a new wiki??
That’s not a new wiki, that’s my mod
ohh lol
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
i didnt know it was a 1.20 feature of kjs tbh (in hindsight its really obvious tho lol)
It’s currently building, I updated KJS and fabric versions so that it has the latest docs for both
There we go!
nice!
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
thatd be amazing
im looking through there and theres some pretty cool stuff like setDisplayName and setIcon
Okay, without using regex you can do something like this:
[➤](#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.
Here is one using regex:
[➤](#1226617038139686962 message)
/create:cutting\/(.*?)(?:_log|_wood|_stem|_hyphae)/
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?
Possibly by getting the list of items first, and then combine them into one list, and then sort them by that criteria