diff --git a/src/de/steamwar/spectatesystem/PacketProcessor.java b/src/de/steamwar/spectatesystem/PacketProcessor.java index 737bb7a..de62fe3 100644 --- a/src/de/steamwar/spectatesystem/PacketProcessor.java +++ b/src/de/steamwar/spectatesystem/PacketProcessor.java @@ -88,7 +88,11 @@ class PacketProcessor { private void entityDespawns() throws IOException{ int entityId = source.rInt(); - Bukkit.getScheduler().runTask(SpectateSystem.get(), () -> REntity.getEntity(entityId).remove()); + Bukkit.getScheduler().runTask(SpectateSystem.get(), () -> { + REntity rEntity = REntity.getEntity(entityId); + if (rEntity == null) return; + rEntity.remove(); + }); } private void entitySneak() throws IOException {