Table of Contents
How to cast a skill
Make sure you first learn about skills and skill slots. MMOCore offers multiple ways of casting skills:
- using key combos (the most popular!)
- using the [1] to [9] keys
- using the mouse scroller
- using a command
Make sure you restart your server when editing your skill casting configuration.
Using key combos
Key combos like Left-Right-Left can be used to cast skills. Players can start a combo by pressing the first key of any of the configured combos, which will temporarily alter the player's action bar, and display their current key combo there. As soon as MMOCore recognizes a valid key combo that is bound to some skill slot, it will cast the corresponding skill.
One combo can be used to cast the skill bound to one specific slot. Therefore, there are as many valid key combos as there are skill slots. This implies that a specific key combo won't make two players cast the same skill (unless they have bound the same skill to the same skill slot). A few examples (the default configuration):
- LEFT -> RIGHT -> LEFT will cast the skill on the 1st slot
- LEFT -> RIGHT -> RIGHT will cast the skill on the 2st slot
- LEFT -> RIGHT -> DROP will cast the skill on the 3st slot
- And so on...
Keybind list
These are the different keybinds that you can use inside of a combo. For instance, you can choose to start every combo with a right click, and then every combo is a combination or right or left clicks. Bukkit click events are canceled when performing a combo, which means you are temporarily unable to interact with any item/spell when performing a combo.
Keybind | Comment |
---|---|
LEFT_CLICK | When left clicking |
RIGHT_CLICK | When right clicking |
DROP | Only works when holding an item |
SWAP_HANDS | When swapping main and off hand items |
CROUCH | When enabling crouch mode |
How to setup
Head to MMOCore/config.yml
and replace the skill-casting
config section for the following code snippet:
skill-casting:
mode: KEY_COMBOS
initializer-key: SWAP_HANDS # Optional. Press to enter skill casting, otherwise any combo key will automatically have the player enter skill casting.
quit-key: SWAP_HANDS # Optional. Press to quit skill casting. Can be the same as the 'initializer-key'
stay-in: false # When enabled, player will remain in skill-casting after casting a skill.
allowed-keys: # Disable some keys here, MMOCore will stop listening to them.
- LEFT_CLICK
- RIGHT_CLICK
- DROP
- SWAP_HANDS
- CROUCH
sound:
begin-combo: # When entering combo casting
sound: BLOCK_END_PORTAL_FRAME_FILL
volume: 1
pitch: 2
combo-key: # The click sound whenever pressing a keybind
sound: BLOCK_LEVER_CLICK
volume: 1
pitch: 2
fail-combo: # If the keybind sequence does not correspond to any preconfigured combo
sound: BLOCK_FIRE_EXTINGUISH
volume: 1
pitch: 2
fail-skill: # If you cast a skill but it fails.
sound: BLOCK_FIRE_EXTINGUISH
volume: 1
pitch: 2
action-bar:
prefix: "&c❤ {health}/{max_health} &f| "
suffix: " &f| {mana_icon} {mana}/{max_mana} &f| &7⛨ {armor}"
is-subtitle: false #If the message is shown as a subtitle rather than in the action-bar.
separator: ' - '
no-key: '****'
key-name:
LEFT_CLICK: 'LEFT'
RIGHT_CLICK: 'RGHT'
DROP: 'DROP'
SWAP_HANDS: 'SWAP'
CROUCH: 'SHFT'
combos:
'1':
- LEFT_CLICK
- LEFT_CLICK
'2':
- LEFT_CLICK
- SWAP_HANDS
'3':
- RIGHT_CLICK
- LEFT_CLICK
'4':
- SWAP_HANDS
- RIGHT_CLICK
'5':
- RIGHT_CLICK
- SWAP_HANDS
'6':
- LEFT_CLICK
- RIGHT_CLICK
Initializer/quit keys
The initializer-key
option is optional. It is the key players need to press first in order to start any combo. When unset, pressing the first key of any combo will start a new combo.
Similarily, the quit-key
is optional. This key will cancel the current combo when pressed. Additionally, if the stay-in
option is toggled on, players can cast as many combos as they want in a row without leaving skill casting (action bar stays on).
Class-Specific Key Combos
Every class can have different combo-to-skill slot bindings. Class bindings take precedence over bindings defined in the plugin main config. In order to setup class-specific combo bindings, paste the following code snippet into your MMOCore/class/<...>.yml
config file and edit it to your liking.
key-combos:
'1':
- RIGHT_CLICK
- LEFT_CLICK
- RIGHT_CLICK
'2':
- RIGHT_CLICK
- RIGHT_CLICK
'3':
- RIGHT_CLICK
- LEFT_CLICK
'4':
- RIGHT_CLICK
- SWAP_HANDS
'5':
- RIGHT_CLICK
- SWAP_HANDS
'6':
- LEFT_CLICK
- RIGHT_CLICK
Using the [1] to [9] keys
The way of casting skills utilizes the action bar. Players must press some key ([F] by default) which will have them enter casting mode. While in casting mode, the player's bound skills are displayed onto the action bar, along with their respective cooldown if they happen to be on cooldown. Skills that are castable appear green, skills on cooldown appear red, and skills which you cannot cast due to low mana appear blue.
While in casting mode, pressing any key from [1] to [6] will cast the skill bound to that slot.
Players can leave casting mode by pressing the same key again. They can't enter the casting mode while in creative.
How to setup
Head to MMOCore/config.yml
and replace the skill-casting
config section for the following code snippet:
skill-casting:
mode: SKILL_BAR
open: SWAP_HANDS
disable-sneak: false
use-lowest-keybinds: true
disable-sneak
prevents the skill bar from opening if the player is sneaking when pressing the input keybind.
use-lowest-keybinds
makes MMOCore choose the lowest available keybinds for castable skills. Since you can leave some skill slots empty or even bind a passive skill (uncastable) to a skill slot, the player might have empty slots before their first active (castable) skill. By toggling on this option, all active skills are "shifted to the left" to use the lowest available keybinds ([1] first, then [2], etc...)
Skill Slot Offset
You may notice the keys you need to press on the screenshot are not exactly all the keys from [1] to [6]. Since the player's held item slot is currently the 4th slot of his hotbar, he cannot press [4] (Minecraft does not register useless slot swaps) and therefore he cannot cast the skill he bound to his 4th skill slot. This is why all the skill slots after the 4th slot have been offset by 1.
If the player holds his item in the 7th, 8th or 9th slot of his hotbar, there will be no offset.
Skill Scroller
This is another less popular skill casting method. You first press a specific key (set to [F] by default) to enter casting mode. From there, use your mouse scroller to navigate through your skill list. The skill currently selected appears on the player's action bar. Then press another key (set to [R] by default) to cast the selected key.
How to setup
Head to MMOCore/config.yml
and replace the skill-casting
config section for the following code snippet:
skill-casting:
mode: SKILL_SCROLLER
enter-key: SWAP_HANDS
action-bar-format: 'CLICK TO CAST: {selected}'
cast-key: DROP
sound:
enter:
sound: BLOCK_END_PORTAL_FRAME_FILL
volume: 1
pitch: 2
change:
sound: BLOCK_LEVER_CLICK
volume: 1
pitch: 2
leave:
sound: BLOCK_FIRE_EXTINGUISH
volume: 1
pitch: 2
Using commands
MMOCore features commands to cast skills ; they are available at anytime (even if skill casting is disabled).
The following command will cast the n-th castable skill of the given player.
/mmocore cast first <player> <slot>
The following command will have the given player cast the skill on their n-th skill slot.
/mmocore cast specific <player> <slot>
For instance, let's take the following scenario:
- Slot 1: No skill bound
- Slot 2: Some passive skill
- Slot 3: Active Skill n1
- Slot 4: Active Skill n2
/mmocore cast first <player> 1
will cast the 1st castable skill hence on slot 3. The skill on slot 2 cannot be cast since it is passive. /mmocore cast first <player> 2
will cast the 2nd castable skill hence on slot 4. /mmocore cast first <player> 3
and higher indices will return an error.
/mmocore cast specific <player> 1
will result in an error. /mmocore cast specific <player> 2
will also result in an error because the skill on slot 2 is not castable. /mmocore cast specific <player> 3
will cast the skill on slot 3, and so on.
Disable skill casting
If you are not using class skills or if you are not planning on adding active skills, you can just disable skill casting by using the following config section snippet. Since MMOCore 1.9.3 this option can be used to free all your player keybinds.
skill-casting:
mode: NONE
Disable skill casting particle
In order to disable casting particles you will need to delete the cast-particle
config section from your class config file.
Timeout for skill casting
Since MMOCore 1.12.1 development builds, you can add a timeout to skill casting. If no activity is detected for more than X seconds, skill casting will end instantly. It's very simple to setup, just add the following option to your existing skill-casting
config section. This option supports all casting modes.
skill-casting:
...
time-out: 200 # 10 seconds (in ticks)
If you're willing to disable casting timeout, just don't put/remove this field from the skill-casting
config section.