9
0
mirror of https://github.com/Auxilor/EcoMobs.git synced 2025-12-21 16:09:24 +00:00

Added despawn sounds and messages

This commit is contained in:
Auxilor
2021-08-13 14:33:58 +01:00
parent 99de824b04
commit 1918a46678
6 changed files with 75 additions and 4 deletions

View File

@@ -169,6 +169,12 @@ public class EcoBoss extends PluginDependent<EcoPlugin> {
@Getter
private final List<OptionedSound> summonSounds;
/**
* Despawn sounds.
*/
@Getter
private final List<OptionedSound> despawnSounds;
/**
* Spawn messages.
*/
@@ -181,6 +187,12 @@ public class EcoBoss extends PluginDependent<EcoPlugin> {
@Getter
private final List<String> deathMessages;
/**
* Despawn messages.
*/
@Getter
private final List<String> despawnMessages;
/**
* Nearby players radius.
*/
@@ -381,6 +393,16 @@ public class EcoBoss extends PluginDependent<EcoPlugin> {
));
}
this.despawnSounds = new ArrayList<>();
for (String string : this.getConfig().getStrings("sounds.despawn")) {
String[] split = string.split(":");
this.despawnSounds.add(new OptionedSound(
Sound.valueOf(split[0].toUpperCase()),
Float.parseFloat(split[1]) / 16,
Float.parseFloat(split[2])
));
}
// Messages
this.spawnMessages = new ArrayList<>();
for (String string : this.getConfig().getStrings("broadcast.spawn")) {
@@ -390,6 +412,10 @@ public class EcoBoss extends PluginDependent<EcoPlugin> {
for (String string : this.getConfig().getStrings("broadcast.death")) {
this.deathMessages.add(StringUtils.format(string));
}
this.despawnMessages = new ArrayList<>();
for (String string : this.getConfig().getStrings("broadcast.despawn")) {
this.despawnMessages.add(StringUtils.format(string));
}
// Top Damager Commands
this.topDamagerCommands = new HashMap<>();

View File

@@ -2,6 +2,8 @@ package com.willfp.ecobosses.bosses.tick.tickers;
import com.willfp.ecobosses.bosses.EcoBoss;
import com.willfp.ecobosses.bosses.tick.BossTicker;
import com.willfp.ecobosses.bosses.util.obj.OptionedSound;
import org.bukkit.Bukkit;
import org.bukkit.entity.LivingEntity;
import org.jetbrains.annotations.NotNull;
@@ -20,6 +22,14 @@ public class DeathTimeTicker implements BossTicker {
if (timeLeft <= 0) {
entity.remove();
boss.removeLivingBoss(entity);
for (String despawnMessage : boss.getDespawnMessages()) {
Bukkit.broadcastMessage(despawnMessage);
}
for (OptionedSound sound : boss.getDespawnSounds()) {
entity.getWorld().playSound(entity.getLocation(), sound.sound(), sound.volume(), sound.pitch());
}
}
}
}

View File

@@ -1,6 +1,6 @@
enabled: true
name: "&fAlpha Wolf &7| &c%health%♥" # Display name
name: "&fAlpha Wolf &7| &c%health%♥ &7| &e%time%" # Display name
base-mob: wolf # Any existing mob - custom_illusioner is also accepted (like in the old Illusioner plugin)
bossbar:
@@ -12,6 +12,7 @@ max-health: 600
attack-damage: 50
movement-speed: 2
follow-range: 15
time-to-live: 120 # Time to live before auto despawn, in seconds. Set to -1 to disable.
auto-spawn-interval: -1 # Time between auto spawns in ticks (20 ticks in a second) - Set to -1 to disable.
auto-spawn-locations: [ ] # Formatted as world:x:y:z - for example world_nether:100:10:100
@@ -56,6 +57,10 @@ broadcast:
- "&f - %second%&f (%second_damage% Damage)"
- "&f - %third%&f (%third_damage% Damage)"
- ""
despawn:
- ""
- "&fYou ran out of time to kill the &lAlpha Wolf&r&f!"
- ""
# Effects can be found on the wiki! https://ecobosses.willfp.com/
effects:
@@ -104,6 +109,10 @@ sounds:
- "entity_wolf_death:50:0.7"
- "entity_wolf_growl:50:0.8"
despawn:
- "entity_ender_dragon_ambient:50:0.5"
- "entity_enderman_death:50:0.5"
summon: # On summon enemy
- "entity_wolf_pant:10:0.8"

View File

@@ -1,6 +1,6 @@
enabled: true
name: "&9Illusioner &7| &c%health%♥" # Display name
name: "&9Illusioner &7| &c%health%♥ &7| &e%time%" # Display name
base-mob: custom_illusioner # Any existing mob - custom_illusioner is also accepted (like in the old Illusioner plugin)
bossbar:
@@ -57,6 +57,10 @@ broadcast:
- "&f - &9%second%&f (%second_damage% Damage)"
- "&f - &9%third%&f (%third_damage% Damage)"
- ""
despawn:
- ""
- "&fYou ran out of time to kill the &9&lIllusioner&r&f!"
- ""
# Effects can be found on the wiki! https://ecobosses.willfp.com/
effects:
@@ -109,6 +113,10 @@ sounds:
- "entity_illusioner_prepare_blindness:50:1"
- "entity_wither_death:50:2"
despawn:
- "entity_ender_dragon_ambient:50:0.5"
- "entity_enderman_death:50:0.5"
summon: # On summon enemy
- "entity_evoker_prepare_attack:10:2"

View File

@@ -1,6 +1,6 @@
enabled: true
name: "&8Steel Golem &7| &c%health%♥" # Display name
name: "&8Steel Golem &7| &c%health%♥ &7| &e%time%" # Display name
base-mob: iron_golem # Any existing mob - custom_illusioner is also accepted (like in the old Illusioner plugin)
bossbar:
@@ -12,6 +12,7 @@ max-health: 1200
attack-damage: 90
movement-speed: 1.5
follow-range: 16
time-to-live: 120 # Time to live before auto despawn, in seconds. Set to -1 to disable.
auto-spawn-interval: -1 # Time between auto spawns in ticks (20 ticks in a second) - Set to -1 to disable.
auto-spawn-locations: [] # Formatted as world:x:y:z - for example world_nether:100:10:100
@@ -56,6 +57,10 @@ broadcast:
- "&f - &8%second%&f (%second_damage% Damage)"
- "&f - &8%third%&f (%third_damage% Damage)"
- ""
despawn:
- ""
- "&fYou ran out of time to kill the &8&lSteel Golem&r&f!"
- ""
# Effects can be found on the wiki! https://ecobosses.willfp.com/
effects:
@@ -109,6 +114,10 @@ sounds:
- "entity_ender_dragon_death:50:1.8"
- "entity_wither_death:50:1.2"
despawn:
- "entity_ender_dragon_ambient:50:0.5"
- "entity_enderman_death:50:0.5"
summon: # On summon enemy
- "entity_iron_golem_step:10:1.2"

View File

@@ -1,6 +1,6 @@
enabled: true
name: "&4Tarantula &7| &c%health%♥" # Display name
name: "&4Tarantula &7| &c%health%♥ &7| &e%time%" # Display name
base-mob: cave_spider # Any existing mob - custom_illusioner is also accepted (like in the old Illusioner plugin)
bossbar:
@@ -12,6 +12,7 @@ max-health: 900
attack-damage: 70
movement-speed: 1.3
follow-range: 15
time-to-live: 120 # Time to live before auto despawn, in seconds. Set to -1 to disable.
auto-spawn-interval: -1 # Time between auto spawns in ticks (20 ticks in a second) - Set to -1 to disable.
auto-spawn-locations: [ ] # Formatted as world:x:y:z - for example world_nether:100:10:100
@@ -56,6 +57,10 @@ broadcast:
- "&f - &4%second%&f (%second_damage% Damage)"
- "&f - &4%third%&f (%third_damage% Damage)"
- ""
despawn:
- ""
- "&fYou ran out of time to kill the &4&lTarantula&r&f!"
- ""
# Effects can be found on the wiki! https://ecobosses.willfp.com/
effects:
@@ -108,6 +113,10 @@ sounds:
- "entity_spider_death:50:0.7"
- "entity_wither_death:50:0.5"
despawn:
- "entity_ender_dragon_ambient:50:0.5"
- "entity_enderman_death:50:0.5"
summon: # On summon enemy
- "entity_spider_step:10:1.2"