Make sure sender is player before applying effects

This commit is contained in:
CocoTheOwner 2021-03-09 15:21:25 +01:00
parent a4bbad3243
commit dd20a06f80

View File

@ -349,9 +349,11 @@ public class ProjectManager
{ {
open(sender, dimm, () -> open(sender, dimm, () ->
{ {
sender.player().removePotionEffect(PotionEffectType.BLINDNESS); if (sender.isPlayer()) {
sender.player().removePotionEffect(PotionEffectType.CONFUSION); sender.player().removePotionEffect(PotionEffectType.BLINDNESS);
sender.player().addPotionEffect(new PotionEffect(PotionEffectType.CONFUSION, 20, 1)); sender.player().removePotionEffect(PotionEffectType.CONFUSION);
sender.player().addPotionEffect(new PotionEffect(PotionEffectType.CONFUSION, 20, 1));
}
}); });
} }