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

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

View File

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

View File

@ -27,4 +27,5 @@ config:
blacklisted-blocks:
- 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
per-level-bonus: 1 # Extra blocks on all sides per level
not-while-sneaking: true

View File

@ -25,4 +25,5 @@ config:
activation-sound: ENTITY_WITHER_SHOOT
cooldown: 40 # In seconds
velocity: 3
damage-per-level: 8
damage-per-level: 8
not-while-sneaking: false

View File

@ -24,4 +24,5 @@ config:
activation-sound: ENTITY_ENDER_DRAGON_GROWL
cooldown: 40 # In seconds
damage-per-level: 3
radius-per-level: 2
radius-per-level: 2
not-while-sneaking: false

View File

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