From 7fb3c7343f00da1aaceb947902e58d49ed8330e8 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Thu, 9 Mar 2017 21:01:10 +0000 Subject: [PATCH] Fit attribute value to range when applying slowness, close #410 According to http://minecraft.gamepedia.com/Status_effect#Slowness, anything higher than slowness 7 will cause the player to be unable to move. Therefore this value should be clamped to a minimum of 0, not crash. --- src/pocketmine/entity/Effect.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pocketmine/entity/Effect.php b/src/pocketmine/entity/Effect.php index 9837894e0..9327c2042 100644 --- a/src/pocketmine/entity/Effect.php +++ b/src/pocketmine/entity/Effect.php @@ -293,7 +293,7 @@ class Effect{ $speed = $attr->getValue(); } $speed *= (1 - 0.15 * $this->amplifier); - $attr->setValue($speed); + $attr->setValue($speed, true); } }