diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/EcoBoss.java b/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/EcoBoss.java index ddb1b95..81afda2 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/EcoBoss.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/EcoBoss.java @@ -169,6 +169,12 @@ public class EcoBoss extends PluginDependent { @Getter private final List summonSounds; + /** + * Despawn sounds. + */ + @Getter + private final List despawnSounds; + /** * Spawn messages. */ @@ -181,6 +187,12 @@ public class EcoBoss extends PluginDependent { @Getter private final List deathMessages; + /** + * Despawn messages. + */ + @Getter + private final List despawnMessages; + /** * Nearby players radius. */ @@ -381,6 +393,16 @@ public class EcoBoss extends PluginDependent { )); } + 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 { 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<>(); diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/tick/tickers/DeathTimeTicker.java b/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/tick/tickers/DeathTimeTicker.java index 9d33479..ccc33a0 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/tick/tickers/DeathTimeTicker.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/tick/tickers/DeathTimeTicker.java @@ -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()); + } } } } diff --git a/eco-core/core-plugin/src/main/resources/bosses/alpha_wolf.yml b/eco-core/core-plugin/src/main/resources/bosses/alpha_wolf.yml index e7f192e..c682b41 100644 --- a/eco-core/core-plugin/src/main/resources/bosses/alpha_wolf.yml +++ b/eco-core/core-plugin/src/main/resources/bosses/alpha_wolf.yml @@ -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" diff --git a/eco-core/core-plugin/src/main/resources/bosses/illusioner.yml b/eco-core/core-plugin/src/main/resources/bosses/illusioner.yml index 557c4b5..919a80f 100644 --- a/eco-core/core-plugin/src/main/resources/bosses/illusioner.yml +++ b/eco-core/core-plugin/src/main/resources/bosses/illusioner.yml @@ -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" diff --git a/eco-core/core-plugin/src/main/resources/bosses/steel_golem.yml b/eco-core/core-plugin/src/main/resources/bosses/steel_golem.yml index f2b9c09..90293f5 100644 --- a/eco-core/core-plugin/src/main/resources/bosses/steel_golem.yml +++ b/eco-core/core-plugin/src/main/resources/bosses/steel_golem.yml @@ -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" diff --git a/eco-core/core-plugin/src/main/resources/bosses/tarantula.yml b/eco-core/core-plugin/src/main/resources/bosses/tarantula.yml index 53b32ab..b016483 100644 --- a/eco-core/core-plugin/src/main/resources/bosses/tarantula.yml +++ b/eco-core/core-plugin/src/main/resources/bosses/tarantula.yml @@ -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"