Custom Skills & Traits

Link to custom-skills--traits

Credits goes out to Kindlich for writing most of the Custom Content implementation!

Custom Traits:

Link to custom-traits

Implementation Syntax:

Link to implementation-syntax

Copy
Examples:
mods.compatskills.TraitCreator.createTrait(String traitName, int x, int y, String skillLocation, int cost, @Optional String... requirements)
mods.compatskills.TraitCreator.createTrait(String traitName, int x, int y, CrTSkill parentSkill, int cost, @Optional String... requirements)
mods.compatskills.TraitCreator.createNewTrait(String traitLocation, int x, int y, String skillLocation, int cost, @Optional String... requirements)
mods.compatskills.TraitCreator.createNewTrait(String traitLocation, int x, int y, CrTSkill parentSkill, int cost, @Optional String... requirements)


"traitName" VS "traitLocation" is the same as in Skills.

"CrTSkill parentSkill" is the Skill Bracket Handler.


So a functional Example would be:
var test = mods.compatskills.TraitCreator.createTrait("test", 2, 3, "compatskills:banana", 1, "compatskills:banana|5");
var test1 = mods.compatskills.TraitCreator.createTrait("test", 2, 3, "<skill:compatskills:banana>", 1, "compatskills:banana|5");
var test2 = mods.compatskills.TraitCreator.createTrait("broken:test", 2, 3, "compatskills:banana", 1, "compatskills:banana|5");
var test3 = mods.compatskills.TraitCreator.createTrait("broken:test", 2, 3, "<skill:compatskills:banana>", 1, "compatskills:banana|5");
ReferenceProperty NameImplementation
Reference
CrTTrait
Property Name
name
Implementation
See Below
Reference
CrTTrait
Property Name
description
Implementation
See Below
Copy
// Creates the trait as a variable
var trait = mods.compatskills.TraitCreator.createTrait("test", 2, 3, "compatskills:banana", 1, "compatskills:banana|5");

// Hard-Sets the name to "Test"
// Be aware this makes localization through .lang files not possible!
trait.name = "Test"

// Hard-Sets the description to "Hello, I'm a Description"
// Be aware this makes localization through .lang files not possible!
trait.description = "Hello, I'm a Description"

ZenSetters/ZenGetters

Link to zensetterszengetters

Method TypeMethod NameValues
Method Type
Setter
Method Name
setEnabled
Values
Takes a Boolean
Method Type
Getter
Method Name
getEnabled
Values
Returns a Boolean
Method Type
Getter
Method Name
getName
Values
Returns the localized String Name of the Trait
Method Type
Getter
Method Name
getDescription
Values
Returns the localized String Description of the Trait
Method Type
Getter
Method Name
retrieveIcon
Values
Returns an Resource Location
Method Type
Setter
Method Name
changeIcon
Values
Takes an Resource Location String

Localization & Resource Location References:

Link to localization--resource-location-references

Copy
Trait Icons:

Either:
- mods.compatskills.TraitCreator.createTrait(String traitName, int x, int y, String skillLocation, int cost, @Optional String... requirements);
	- compatskills:textures/unlockables/traitname.png

- mods.compatskills.TraitCreator.createNewTrait(String traitLocation, int x, int y, String skillLocation, int cost, @Optional String... requirements);
	- customResourceLocation:/textures/unlockables/traitname.png


Localizations are placed in:
- compatskills:lang/localeCode.lang

or

- customResourceLocation:lang/localeCode.lang

Go to this link to see all possible Locale-Codes! The Minecraft Wiki's Language Page