From fe3ca95c764848be56e872e3de57c66cb07d7515 Mon Sep 17 00:00:00 2001 From: chickeneer Date: Sat, 3 Jun 2017 00:44:10 -0500 Subject: [PATCH] Prevent NPE when setting tempt target to null --- nms-patches/PathfinderGoalTempt.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nms-patches/PathfinderGoalTempt.patch b/nms-patches/PathfinderGoalTempt.patch index e057409407..ec9ecd2649 100644 --- a/nms-patches/PathfinderGoalTempt.patch +++ b/nms-patches/PathfinderGoalTempt.patch @@ -34,7 +34,7 @@ + if (event.isCancelled()) { + return false; + } -+ this.target = ((CraftLivingEntity) event.getTarget()).getHandle(); ++ this.target = (event.getTarget() == null) ? null : ((CraftLivingEntity) event.getTarget()).getHandle(); + } + return tempt; + // CraftBukkit end