#disabling / adding materials to tinkers construct

46 messages · Page 1 of 1 (latest)

brisk ice
#

i would like to know if it is possible to disable tool parts for only certain materials
i am making a modpack and i would like to disable some materials so that they wont be used, for example i don't want bone / slimewood / seared stone and other materials to be used in tool creation
i have tried to disable the recipes for the tool parts, but obviously every material was disabled (i have materials in every types of crafting, this means: builder / casts and composite)
i don't even know if it is possible to do that with kubejs (even with the addon) so i'd like to ask here

(thanks for the time if you put any into this post)

drifting starBOT
#

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

quick orchid
#

Not sure if the event was changed for 1.19, but could do something for that on 1.18

silver gyro
#

eyyyyyy

#

i know you XD

brisk ice
#

(shoot i got the wrong version, it is 1,18)

quick orchid
#
onEvent('server.datapack.first', event => {
    console.log('Datapack first event triggered')
       let disabledMaterials = ['seared_stone', 'bone']
disabledMaterials.forEach((material) => {
 event.addJson(`tconstruct:tinkering/materials/definition/${material}.json`, {
            "craftable": false,
            "hidden": true
        })
})
})
silver gyro
#

nice

quick orchid
#

Phone posting so not able to fix the syntax

brisk ice
#

dw i'll see if this works ^^

quick orchid
#

You'll just need to add the material name to that list, should be simple for server scripts. Should disable the material recipes?

brisk ice
#

just for clarification, in wich file should i put it?

quick orchid
#

It's a server script, so server scripts

#

I think I forgot a bracket under the for each

#

Edited it again

brisk ice
#

maybe, don't worry i'll see what i can do with this, (i'm new to javascript so i'm just trying to understand first ^^')

quick orchid
#

Tinkers is all datapack driven so it's hard to do with kubejs

#

I'm trying to write a 1.18 script to automate the material creation, and it's mostly done

#

But it should also work for disabling stuff too

brisk ice
#

wow there's even a hidden thing that's incredible

#

thx a lot, really

#

now could i push it further and ask if there's a way to disable crafting with a material but only for certain partsd

#

(for exemple let's say i would like nuhatl (the obsidian wood material) to be able to craft only the bow grip and bow limb, how could i?)

quick orchid
#

Possible but more of a pain, that's handled through the construct/materials/stats folder

brisk ice
#

yeah i saw that

quick orchid
#

Better off just copying the existing file from the tinkers jar and putting it in the kubejs data folder

#

You'll have to just remove the tool part stat definitions for the parts you don't want

brisk ice
#

wait that's a feature of kubejs?

quick orchid
#

No, it's just that kubejs functions as a datapack loader

brisk ice
#

oh

quick orchid
#

Anything in the data or asset folder can "override" files in a mod jar

#

Can use it to rename things in the mod language files, etc

brisk ice
#

oh ok

#

so it works for "ressource packs" too?

quick orchid
#

In the sense that you can override textures, yeah

brisk ice
#

oh that's really nice

#

well thank you a lot for everything it was a pleasure ^^
(oh and for information if someone else reads this, the code worked without any change, only add to the list in line 3)

quick orchid
#

Glad it worked! I'll post my 1.18 example script eventually

brisk ice
#

thank you, i'll give it a read

#

oh actually, yes i know i'm annoying but can you use the list outside the onEvent thing?

quick orchid
#

You could define it outside the event and call it, yeah

#

I usually have a "global" file where I define my recipe functions and a list of metals/colors

#

Like, if you define disabledMaterials outside the event you can call it within the event and in other files

brisk ice
#

ok perfect