### Getting and Setting Mana Source: https://github.com/archy-x/auraskills/blob/master/wiki/api.md Example of how to get and set a player's current mana. ```java double mana = user.getMana(); // Check that the user has enough mana before removing it if (mana >= 10.0) { user.setMana(mana - 10.0); } else { // Handle not enough mana case } // Gets the user's max mana (determined by the Wisdom stat) double maxMana = user.getMaxMana(); ``` -------------------------------- ### Example stats.yml Source: https://github.com/archy-x/auraskills/blob/master/wiki/api.md An example configuration file for defining stats and traits. ```yaml stats: pluginnamne/dexterity: enabled: true traits: pluginname/dodge_chance: modifier: 0.5 # Overrides the value passed in with CustomStatBuilder#trait traits: pluginname/dodge_chance: enabled: true # Add configurable options here accessed using Trait#option... methods ``` -------------------------------- ### Getting and Adding Skill XP Source: https://github.com/archy-x/auraskills/blob/master/wiki/api.md Example of how to get and add skill experience points for a player. ```java double xp = user.getSkillXp(Skills.FARMING); user.addSkillXp(Skills.FARMING, 20.0); user.addSkillXpRaw(Skills.FARMING, 15.0); // Ignores any XP multipliers // Sets XP to 0, resetting progress for only the current skill level user.setSkillXp(Skills.FARMING, 0.0); ``` -------------------------------- ### Open Menu Command Properties Example Source: https://github.com/archy-x/auraskills/blob/master/Changelog.md Example JSON string for the properties argument of the openmenu command. ```json {"skill":"Skill:mining"} ``` -------------------------------- ### Tag Wildcard Example Source: https://github.com/archy-x/auraskills/blob/master/wiki/sources.md An example demonstrating the use of a wildcard with text prefix for tags, applying the tag to sources starting with 'stripped_'. ```yaml tags: farming_luck_applicable: - 'stripped_*' ``` -------------------------------- ### Command loot example Source: https://github.com/archy-x/auraskills/blob/master/wiki/loot.md A basic example of command loot configuration. ```yaml - type: command weight: 10 executor: console command: say hi ``` -------------------------------- ### Start a server (Linux/macOS) Source: https://github.com/archy-x/auraskills/blob/master/CONTRIBUTING.md Gradle task to build the plugin and start a test server on Linux or macOS. ```bash ./gradlew clean :bukkit:runServer ``` -------------------------------- ### Start a server (Windows) Source: https://github.com/archy-x/auraskills/blob/master/CONTRIBUTING.md Gradle task to build the plugin and start a test server on Windows. ```bat .\gradlew.bat clean :bukkit:runServer ``` -------------------------------- ### Basic item loot example Source: https://github.com/archy-x/auraskills/blob/master/wiki/loot.md A simple example of an item loot configuration. ```yaml - type: item material: iron_ingot weight: 10 amount: 1-3 ``` -------------------------------- ### LuckPerms Examples Source: https://github.com/archy-x/auraskills/blob/master/wiki/skills/xp-multipliers.md Examples of adding and removing XP multipliers using the LuckPerms permissions plugin. ```bash /lp user [player] permission set auraskills.multiplier.100 ``` ```bash /lp group vip permission set auraskills.multiplier.50 ``` ```bash /lp group default permission settemp auraskills.multiplier.200 true 12h ``` ```bash /lp user [player] permission unset auraskills.multiplier.100 ``` -------------------------------- ### Skill Registration Example Source: https://github.com/archy-x/auraskills/blob/master/wiki/api.md Example of registering a custom skill in the plugin's onEnable method. ```java AuraSkillsApi auraSkills = AuraSkillsApi.get(); NamespacedRegistry registry = auraSkills.useRegistry("pluginnanme", getDataFolder()); registry.registerSkill(CustomSkills.TRADING); ``` -------------------------------- ### Item Reward Example Source: https://github.com/archy-x/auraskills/blob/master/wiki/rewards.md An example of an item reward configuration. ```yaml - type: item key: some_item_key amount: 24 ``` -------------------------------- ### Money Reward Example Source: https://github.com/archy-x/auraskills/blob/master/wiki/rewards.md An example of a money reward configuration. ```yaml - type: money amount: 1000 ``` -------------------------------- ### Command Reward Example Source: https://github.com/archy-x/auraskills/blob/master/wiki/rewards.md An example of a command reward configuration. ```yaml - type: command executor: console command: say leveled up! revert_executor: console revert_command: say removed level up ``` -------------------------------- ### Configurable Ability Values Example Source: https://github.com/archy-x/auraskills/blob/master/wiki/api.md Example of an abilities.yml file to make ability values configurable. ```yaml abilities: pluginname/magic_archer: enabled: true base_value: 15 value_per_level: 10 unlock: 6 level_up: 5 max_level: 0 ``` -------------------------------- ### Custom Ability Builder Example Source: https://github.com/archy-x/auraskills/blob/master/wiki/api.md Example of creating a custom ability using CustomAbility.builder. ```java public class CustomAbilities { public static final CustomAbility MAGIC_ARCHER = CustomAbility .builder(NamespacedId.of("pluginname", "magic_archer") .displayName("Magic Archer") .description("Gain {value}% more XP when using spectral or tipped arrows.") .info("+{value}% Special Arrow XP ") .baseValue(20) // Value when at level 1 .valuePerLevel(10) // Value added per ability level .unlock(6) // Skill level ability unlocks at .levelUp(5) // Skill level interval between ability level ups .maxLevel(0) // 0 = unlimited max level, but capper by the max skill level .build(); } ``` -------------------------------- ### Custom Skill Builder Example Source: https://github.com/archy-x/auraskills/blob/master/wiki/api.md Example of creating a custom skill using the CustomSkill builder. ```java public class CustomSkills { public static final CustomSkill TRADING = CustomSkill .builder(NamespacedId.of("pluginname", "trading")) .displayName("Trading") .description("Trade with villagers to gain Trading XP") .item(ItemContext.builder() .material("emerald") .pos("4,4") .build()) .build(); } ``` -------------------------------- ### MythicCrucible item usage example Source: https://github.com/archy-x/auraskills/blob/master/wiki/compatible-plugins.md Example of how to use the DamageWithMana skill on an item in MythicCrucible. ```yaml Skills: - skill{s=DamageWithMana} @target ~onInteract ``` -------------------------------- ### Direct List of Values Example Source: https://github.com/archy-x/auraskills/blob/master/wiki/skills/xp-requirements.md Example of defining XP requirements using a direct list of values. ```yaml default: values: - 100 - 200 - 300 - 500 - 750 - 1250 - 1720 ``` -------------------------------- ### Default Expression Example Source: https://github.com/archy-x/auraskills/blob/master/wiki/skills/xp-requirements.md Example of a default XP requirement expression with custom variables. ```yaml default: expression: 'multiplier * (level - 2) ^ 2 + base' multiplier: 100.0 base: 100.0 ``` -------------------------------- ### Getting the AuraSkillsApi instance Source: https://github.com/archy-x/auraskills/blob/master/wiki/api.md Obtain the main API instance using the static get() method. ```java AuraSkillsApi auraSkills = AuraSkillsApi.get(); ``` -------------------------------- ### Money Reward Formula Example Source: https://github.com/archy-x/auraskills/blob/master/wiki/rewards.md An example of a money reward configuration using a formula. ```yaml patterns: - type: money formula: '100+10*level*level' pattern: interval: 1 ``` -------------------------------- ### Potion item loot example Source: https://github.com/archy-x/auraskills/blob/master/wiki/loot.md An example of a potion item with base potion data and custom effects. ```yaml - type: item material: potion weight: 10 amount: 1 potion_data: type: speed upgraded: true custom_effects: - type: jump duration: 1000 amplifier: 2 - type: regeneration duration: 40 amplifier: 3 ``` -------------------------------- ### Message shorthand example Source: https://github.com/archy-x/auraskills/blob/master/wiki/rewards.md Example using the 'message' shorthand for both menu and chat messages for a command reward. ```yaml - type: command executor: console command: say leveled up! message: \n Both a menu and chat message ``` -------------------------------- ### Example skill section for Farming Source: https://github.com/archy-x/auraskills/blob/master/wiki/skills/index.md This is an example of a skill section in the skills.yml file, with comments explaining each option. ```yaml auraskills/farming: # The Namespaced ID of the skill abilities: # The list of abilities the skill levels up - auraskills/bountiful_harvest - auraskills/farmer - auraskills/scythe_master - auraskills/geneticist - auraskills/triple_harvest mana_ability: auraskills/replenish # The mana ability of the skill (optional) options: # Configurable options for the skill, see below for details on each option enabled: true max_level: 97 check_cancelled: true check_multiplier_permissions: true ``` -------------------------------- ### Cloning the project and building on Windows Source: https://github.com/archy-x/auraskills/blob/master/README.md Instructions for cloning the AuraSkills repository and building the project using Gradle on Windows. ```bash git clone https://github.com/Archy-X/AuraSkills.git cd AuraSkills/ .\gradlew.bat clean build ``` -------------------------------- ### Getting Stat Level Source: https://github.com/archy-x/auraskills/blob/master/wiki/api.md Example of how to get a player's stat level using the Stats enum. ```java // Gets the user's strength stat level. Use the Stats enum for all default stats. double level = user.getStatLevel(Stats.STRENGTH); // Gets the stat level only from permanent skill rewards (without modifiers). double baseLevel = user.getBaseStatLevel(Stats.HEALTH); ``` -------------------------------- ### Cloning the project and building on Linux/macOS Source: https://github.com/archy-x/auraskills/blob/master/README.md Instructions for cloning the AuraSkills repository and building the project using Gradle on Linux or macOS. ```bash git clone https://github.com/Archy-X/AuraSkills.git cd AuraSkills/ ./gradlew clean build ``` -------------------------------- ### Getting and Setting Skill Level Source: https://github.com/archy-x/auraskills/blob/master/wiki/api.md Example of how to get and set a player's skill level using the Skills enum. ```java // Gets the user's Farming skill level. Use the Skills enum for all default skills. int level = user.getSkillLevel(Skills.FARMING); // Set the Fighting skill to level 10 user.setSkillLevel(Skills.FIGHTING, 10); ``` -------------------------------- ### Jobs Configuration Example Source: https://github.com/archy-x/auraskills/blob/master/Changelog.md Configuration options for the new jobs system, including enabling jobs, income settings, and selection preferences. ```yaml jobs: enabled: true income: use_xp: true income_per_xp: 0.1 use_expression: false expression: "xp * base_xp * level * power * skill_average" use_final_xp: true selection: require_selection: true default_job_limit: 2 default_language: en ``` -------------------------------- ### Enchantment requirement example Source: https://github.com/archy-x/auraskills/blob/master/wiki/skills/block-requirements.md Example of an enchantment requirement. ```yaml - type: enchantment enchantment: sharpness level: 4-5 ``` -------------------------------- ### CustomFishing XP Example Source: https://github.com/archy-x/auraskills/blob/master/wiki/compatible-plugins.md A minimal example demonstrating how to grant AuraSkills fishing XP when a fish is caught using CustomFishing. ```yaml tuna_fish_golden_star: # ... events: success: aurelium_xp: type: plugin-exp value: plugin: AuraSkills exp: 400 target: fishing ``` -------------------------------- ### Item requirement example Source: https://github.com/archy-x/auraskills/blob/master/wiki/skills/block-requirements.md Example of an item requirement. ```yaml - type: item item: diamond_pickaxe ``` -------------------------------- ### Region requirement example Source: https://github.com/archy-x/auraskills/blob/master/wiki/skills/block-requirements.md Example of a region requirement. ```yaml - type: region region: spawn ``` -------------------------------- ### Nexo item examples Source: https://github.com/archy-x/auraskills/blob/master/wiki/compatible-plugins.md Examples of using Nexo items as loot, source menu items, and general menu items. ```yaml loot: - type: item key: nexo:your_item_id ``` ```yaml source_name: menu_item: nexo:your_item_id ``` ```yaml some_menu_item: key: nexo:your_item_id ``` -------------------------------- ### Biome requirement example Source: https://github.com/archy-x/auraskills/blob/master/wiki/skills/block-requirements.md Example of a biome requirement. ```yaml - type: biome biome: swamp ``` -------------------------------- ### Nexo custom block example Source: https://github.com/archy-x/auraskills/blob/master/wiki/compatible-plugins.md Example of adding a Nexo custom block as a source for gaining XP in skills. ```yaml source_name: block: nexo:your_block_id xp: 5 ``` -------------------------------- ### Stat requirement example Source: https://github.com/archy-x/auraskills/blob/master/wiki/skills/block-requirements.md Example of a stat requirement. ```yaml - type: stat stat: toughness value: 15 ``` -------------------------------- ### Default section example Source: https://github.com/archy-x/auraskills/blob/master/wiki/sources.md This example demonstrates how the default section can be used to simplify source configurations by applying common options to multiple sources. ```yaml default: type: brewing trigger: takeout menu_item: material: potion sources: awkward: ingredient: nether_wart xp: 10 menu_item: potion_data: type: awkward ``` -------------------------------- ### World requirement example Source: https://github.com/archy-x/auraskills/blob/master/wiki/skills/block-requirements.md Example of a world requirement. ```yaml - type: world world: world_nether ``` -------------------------------- ### Permission requirement example Source: https://github.com/archy-x/auraskills/blob/master/wiki/skills/block-requirements.md Example of a permission requirement. ```yaml - type: permission permission: some.permission.node ``` -------------------------------- ### Menu Item Example: Dynamic Material Source: https://github.com/archy-x/auraskills/blob/master/wiki/sources.md An example demonstrating the use of a placeholder in the menu_item section to dynamically set the material based on another key, such as 'block'. ```yaml default: type: block trigger: break menu_item: material: '{block}' ``` -------------------------------- ### Equivalent source configuration without default section Source: https://github.com/archy-x/auraskills/blob/master/wiki/sources.md This example shows the expanded version of the previous configuration, illustrating how options from the default section are applied to the specific source. ```yaml sources: awkward: type: brewing # Copied from previous default trigger: takeout # Copied from previous default ingredient: nether_wart xp: 10 menu_item: # The menu_item section is combined with the previous default section material: potion # Material from the previous default potion_data: # Defined key from the source itself type: awkward ``` -------------------------------- ### Permission Reward Example Source: https://github.com/archy-x/auraskills/blob/master/wiki/rewards.md An example of a permission reward configuration. ```yaml - type: permission permission: some.permission.node value: true ``` -------------------------------- ### MythicMobs giveSkillXP mechanic example Source: https://github.com/archy-x/auraskills/blob/master/wiki/compatible-plugins.md Example of how to use the giveSkillXP mechanic in MythicMobs to grant AuraSkills experience when a mob is killed. ```yaml Skills: # xp argument supports placeholder math. # s (skill) argument can be any AuraSkills skill namespaced ID. - giveSkillXP{s=fighting;xp=1000} @trigger ~onDeath ``` -------------------------------- ### Example Click Action to Open Custom Menu Source: https://github.com/archy-x/auraskills/blob/master/wiki/menus.md An example of how to add a click action to an item in an existing menu to open the custom 'test' menu. ```yaml items: your_skills: on_click: - type: menu action: open menu: test ```