Added default effect probability for food

This commit is contained in:
Auxilor
2024-07-21 14:18:06 +01:00
parent c4fa62577a
commit 8ec086ec7d
2 changed files with 2 additions and 1 deletions

View File

@@ -39,7 +39,7 @@ class FoodComponentHandlerImpl : FoodComponentHandler() {
val particles = effectConfig.getBoolOrNull("particles") ?: true val particles = effectConfig.getBoolOrNull("particles") ?: true
val icon = effectConfig.getBoolOrNull("icon") ?: 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( food.addEffect(
PotionEffect( PotionEffect(

View File

@@ -36,3 +36,4 @@ food:
ambient: true # If the potion is ambient (defaults to true) ambient: true # If the potion is ambient (defaults to true)
particles: true # If the potion has particles (defaults to true) particles: true # If the potion has particles (defaults to true)
icon: true # If the potion icon shows up (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)