diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecomobs/category/spawning/impl/SpawnMethodFactoryReplace.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecomobs/category/spawning/impl/SpawnMethodFactoryReplace.kt index bcbcf8c..1b86ed4 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecomobs/category/spawning/impl/SpawnMethodFactoryReplace.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecomobs/category/spawning/impl/SpawnMethodFactoryReplace.kt @@ -2,6 +2,7 @@ package com.willfp.ecomobs.category.spawning.impl import com.willfp.eco.core.config.interfaces.Config import com.willfp.eco.core.entities.Entities +import com.willfp.eco.util.randDouble import com.willfp.ecomobs.EcoMobsPlugin import com.willfp.ecomobs.category.MobCategory import com.willfp.ecomobs.category.spawning.SpawnMethod @@ -57,6 +58,10 @@ object SpawnMethodFactoryReplace : SpawnMethodFactory("replace") { return } + if (randDouble(0.0, 100.0) > config.getDouble("chance")) { + return + } + val mob = category.mobs.randomOrNull() ?: return diff --git a/eco-core/core-plugin/src/main/resources/categories/_example.yml b/eco-core/core-plugin/src/main/resources/categories/_example.yml index 2b37bff..f13c6c3 100644 --- a/eco-core/core-plugin/src/main/resources/categories/_example.yml +++ b/eco-core/core-plugin/src/main/resources/categories/_example.yml @@ -26,6 +26,9 @@ spawning: - zombie - skeleton + # The chance for the mob to override, as a percentage + chance: 100 + # Options for custom spawning custom: