diff --git a/eco-core/core-modern/src/main/kotlin/com/willfp/ecoitems/compat/modern/components/FoodComponentHandlerImpl.kt b/eco-core/core-modern/src/main/kotlin/com/willfp/ecoitems/compat/modern/components/FoodComponentHandlerImpl.kt index 2714324..5b4f44e 100644 --- a/eco-core/core-modern/src/main/kotlin/com/willfp/ecoitems/compat/modern/components/FoodComponentHandlerImpl.kt +++ b/eco-core/core-modern/src/main/kotlin/com/willfp/ecoitems/compat/modern/components/FoodComponentHandlerImpl.kt @@ -39,7 +39,7 @@ class FoodComponentHandlerImpl : FoodComponentHandler() { val particles = effectConfig.getBoolOrNull("particles") ?: true val icon = effectConfig.getBoolOrNull("icon") ?: true - val probability = effectConfig.getDouble("probability").toFloat() / 100f + val probability = (effectConfig.getDoubleOrNull("probability") ?: 100.0).toFloat() / 100f food.addEffect( PotionEffect( diff --git a/eco-core/core-plugin/src/main/resources/items/_example_food.yml b/eco-core/core-plugin/src/main/resources/items/_example_food.yml index fa9e71c..86ae405 100644 --- a/eco-core/core-plugin/src/main/resources/items/_example_food.yml +++ b/eco-core/core-plugin/src/main/resources/items/_example_food.yml @@ -36,3 +36,4 @@ food: ambient: true # If the potion is ambient (defaults to true) particles: true # If the potion has particles (defaults to true) icon: true # If the potion icon shows up (defaults to true) + probability: 100 # The probability of the potion effect occurring (defaults to 100)