Configuring Race Attributes
In this section, you will be learning how to configure attributes for races. These attributes can hook into the ones already existing in the game, such as armor toughness, max health, and a lot more! Take a look here for a list of the Bukkit attributes you can use. There are also some more attributes you can use that hook into other plugins.
Attribute Name | Input | Description | Default Value |
---|---|---|---|
max-mana | int | Max mana for the race. (Requires MagicSpells) | (what is set in the MagicSpells config) |
arrow-damage | int | Additional damage to deal on arrow impact. | 0 |
melee-damage | int | Additional damage to deal on melee hits. | 0 |
swords-damage | int | More specific version of melee-damage but for swords exclusively. | 0 |
axes-damage | int | More specific version of melee-damage but for axes exclusively. | 0 |
health-regen | double | Additional health to give the player upon regenerating, | 0 |
The next part is actually adding this to your race. We will be picking up from the Configuring Race Levels page just for consistency. Adding the attribute part is really simple, you just need to add a new section called attributes and add whatever you please.
race:
name: Werewolf
max-level: 30
require-unlock: true
gui:
slot: 29
icon:
type: player_head
owner: Werewolf
display-name: "&cWerewolf &7| &aUnlocked"
lore:
- '&7At night, a dark curse falls upon'
- '&7this race turning it into a vicious'
- '&7werewolf!'
icon-selected:
type: player_head
owner: Werewolf
display-name: "&cWerewolf &7| &eSelected"
lore:
- '&7At night, a dark curse falls upon'
- '&7this race turning it into a vicious'
- '&7werewolf!'
enchants:
- unbreaking 1
item-flags:
- hide_enchants
icon-locked:
type: skeleton_skull
display-name: "&c??? &7| &cLocked"
lore:
- '&7Defeat the Feral Lycan to'
- '&7unlock this race.'
levels:
1: # The first level
xp: 200 # How much experience you need to level up
skillpoints: 1 # How many skillpoints you get for leveling up
2:
xp: 250
skillpoints: 1
3:
xp: 275 # You don't need to define skillpoints either, but you MUST define how much xp it takes for you to level up.
4:
xp: 300
skillpoints: 1
5:
xp: 350
skillpoints: 2
# You can define as many levels as you want below
attributes:
generic-max-health: 25
generic-armor: 5
generic-attack-speed: 10
max-mana: 250 # MagicSpells mana
There is also support for using PlaceholderAPI placeholders and operators in attributes as well. The valid operators are +
, -
, *
, /
, or =
. Each one should be self explanatory as they are just basic math operators. Multiple operators for longer math equations need to be surrounded in (
)
.
Example:
attributes:
generic-max-health: "+2" # Adds 2 health to the players current health
generic-attack-damage: "/2" # Divides the attack damage of the player by 2
max-mana: "=(100+%pwingraces_level%*10)" # Sets the max mana to 100 plus 10 times the current level
And just like that, attributes have been set up for you race. Pretty simple huh? You can even customize them to be higher or lower depending on what level or what skilltree element a player has purchased. Refer to the pages below for more information.