Can't add "Magnetic" trait as a Custom Material Trait (1.12)(Tinkers' Construct)
Pacca64 opened this issue ยท 3 comments
Using both bracket notation and the identifier string "magnetic" gives the error "Could not Identify trait" suggesting that the trait doesn't exist.
myMaterial.addTrait(<ticontrait:magnetic>);
myMaterial.addTrait("magnetic", "head");
Commenting out attempts to add magnetic allow my material to be added just fine with no issues. I can even added other traits, including ones added by PlusTIC, without any problems.
After looking through Tinkers Constructs source code, I found out some things. First, "magnetic" is indeed the correct identifier string for the trait (I was hoping the issue was merely a typo on my end).
Secondly, and perhaps what might be causing a problem here, is that it is one of a small collection of "Leveled Traits". As far as I can tell, ContentTweaker doesn't provide anyway to include a level when trying to find a trait. The few references to a traits "level" I can find are only used for building brand new traits, or for getting information from a trait you already have a reference to.
I'm honestly unsure if this is some sort of user error, but after scanning the documentation over and over again, and asking for help in the discord, I'm at a loss.
I'm currently testing ZenTraits as a way around this limitation, as it supports leveled traits.
I was wondering how to do this. thanks for the clarification, the wiki is a bit vague
Look through the source code for TiC and other addon mods. See the constructor for the magnetic trait here, use the name that is supered:
I was able to get this to work for me when I did momentum: