diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecomobs/category/spawning/impl/SpawnMethodFactoryCustom.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecomobs/category/spawning/impl/SpawnMethodFactoryCustom.kt index e233dc5..46ed5d0 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecomobs/category/spawning/impl/SpawnMethodFactoryCustom.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecomobs/category/spawning/impl/SpawnMethodFactoryCustom.kt @@ -66,15 +66,16 @@ object SpawnMethodFactoryCustom : SpawnMethodFactory("custom") { private fun tick() { for (player in Bukkit.getOnlinePlayers()) { for (point in player.spawnPoints.filter { it.type in spawnTypes }) { - if (randDouble(0.0, 100.0) > chance) { - continue - } + val mob = category.mobs.randomOrNull() ?: continue if (!conditions.areMet(point.location.toDispatcher(), EmptyProvidedHolder)) { continue } - val mob = category.mobs.randomOrNull() ?: continue + if (randDouble(0.0, 100.0) > chance) { + continue + } + mob.spawn(point.location, SpawnReason.NATURAL) } }