Added option to spells to not activate while sneaking

This commit is contained in:
Auxilor 2021-07-15 23:21:06 +02:00
parent cc922e08ad
commit 7af645dae8
7 changed files with 18 additions and 6 deletions

View File

@ -242,6 +242,12 @@ public abstract class Spell extends EcoEnchant {
}
}
if (this.getConfig().getBool(EcoEnchants.CONFIG_LOCATION + "not-while-sneaking")) {
if (player.isSneaking()) {
return;
}
}
if (cooldown > 0) {
String message = this.getPlugin().getLangYml().getMessage("on-cooldown").replace("%seconds%", String.valueOf(cooldown)).replace("%name%", EnchantmentCache.getEntry(this).getRawName());
player.sendMessage(message);

View File

@ -25,3 +25,4 @@ config:
cooldown: 90 # In seconds
power: 25 # Level of levitation to give
ticks-per-level: 6
not-while-sneaking: false

View File

@ -24,3 +24,4 @@ config:
activation-sound: ENTITY_FIREWORK_ROCKET_LAUNCH
cooldown: 40 # In seconds
velocity-per-level: 1.5
not-while-sneaking: false

View File

@ -28,3 +28,4 @@ config:
- bedrock
base-bonus: 2 # Base extra blocks on all sides to break (1 = 3x3x3, 2 = 5x5x5, 3 = 7x7x7)
per-level-bonus: 1 # Extra blocks on all sides per level
not-while-sneaking: true

View File

@ -26,3 +26,4 @@ config:
cooldown: 40 # In seconds
velocity: 3
damage-per-level: 8
not-while-sneaking: false

View File

@ -25,3 +25,4 @@ config:
cooldown: 40 # In seconds
damage-per-level: 3
radius-per-level: 2
not-while-sneaking: false

View File

@ -26,3 +26,4 @@ general-config:
config:
activation-sound: ENTITY_PLAYER_LEVELUP
cooldown: 450 # In seconds
not-while-sneaking: false