
Skill Tree Mod
Overview
Skill Trees mod is a compact addition that significantly simplifies the process of creating and implementing skill trees for developers of other mods. It offers maximum customization options if the default appearance doesn't meet your requirements. Additionally, this mod provides tools for checking whether players have specific skills. It's important to note that the mod itself doesn't add any pre-made skill trees.
Skill Types
By default, two main types of skills are available, including attribute skills. Attribute skills allow easy modification of player characteristics. While the skill is active and in the player's possession, their statistical indicators will change (for example, double damage, natural armor, speed, etc.). All these changes can be tracked on the player information tab (note: this tab displays all modifiers currently affecting the player).
Basic skills don't perform complex functions on their own but can serve as requirements for performing certain actions (such as crafting swords and other items, using special tools and weapons, interacting with mobs, etc.). Developers can also program special effects when obtaining or removing skills (giving or taking items from the player, creating particles, etc.). Skills can be made toggleable so their effects aren't constant. There's also the possibility of creating ticking skills that activate certain actions every 20 ticks (1 second) of skill activity (night vision, underwater breathing, fire resistance, mana usage, etc.).
Skills can be interconnected, creating dependencies: obtaining more powerful or useful skills may require having certain prerequisite skills. Skills can branch into multiple trees, forming complete skill trees! Connected skills automatically display connecting lines between them.
Skill Points
By default, the mod doesn't add items to the game that give players skill points. However, it provides methods for implementing this function through the API, as well as a base ItemSkillPoint class that allows granting players a certain number of skill points. The method of obtaining skill points is completely up to the developer!
Skill Trees
By default, to view the skill tree, press the 'k' key (this setting can be changed). You'll be taken to the last viewed page or the player information page. Several standard backgrounds are available (same as achievements) with an option to use custom backgrounds.
At first glance, you can determine several important parameters: whether the player has the skill, whether skill requirements are met, skill activity status, and parent skills. If a skill has no lock, it's already obtained. An unlocked lock means the skill can be purchased, while a locked lock indicates it's unavailable. Inactive skills appear gray, active ones - orange. Connected skills are linked with lines (lines can go in any direction; skills don't necessarily need to be placed left to right, any format is possible).
For additional information about a skill, simply hover over it. A tooltip will appear showing the skill name, requirements, and description (all these parameters can be defined in the language file). By default, unmet requirements appear red, met requirements - green, names of obtained skills - yellow, unobtained - white, descriptions - white (these settings can be changed during creation).
To purchase a skill, simply click on it. The skill becomes active immediately after purchase. (Important: after clicking on a skill, if you had the ability to purchase it, it will be purchased!) If the skill is already purchased and is toggleable, clicking it will toggle its state instead. By default, skill trees are preserved after death. This can be changed in the configuration. (My EasyConfig class is included in the mod and can be freely used!).
Skill Requirements
Skill requirements play a crucial role since without them players could simply purchase all skills. There are 5 standard requirements, but you can easily create custom ones by implementing the ISkillRequirment interface. The first two added requirements are Name Requirement and Description Requirement. They add names and descriptions to skill tooltips and are created automatically by default. There are several methods for interacting with them, but you probably won't need them unless creating skills with non-standard behavior.
The next common requirement is the parent requirement. It's also created and added to the skill automatically. The last two requirements are Skill Point Requirement and Level Requirement. The former requires a certain number of skill points that are consumed upon purchase, while the latter works similarly but for experience levels.
Commands
The mod adds commands for interacting with the skill tree. Currently, 4 commands are available: reset, addPoints, give, and remove. Type "/sk" to view usage. Most arguments support Tab autocompletion.
Server Compatibility
The mod is fully server compatible and has been tested. If any bugs are found, please report them on the GitHub below.
Creating Skill Trees
For documentation and examples of creating skill trees, visit GitHub.
License
All rights reserved. However, you can modify the mod for personal use but not distribute it. All links must be direct (without using link shortening services) and lead to this page or the Minecraft forum page.