package net.simpvp.Misc;

import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityPotionEffectEvent;
import org.bukkit.potion.PotionEffectType;

public class PotionEffectListener implements Listener {
	@EventHandler
	public void potionEffectEvent(EntityPotionEffectEvent event) {

		if (event.getEntity().getLocation().distance(event.getEntity().getWorld().getSpawnLocation()) <= 200) {
			if (event.getModifiedType().equals(PotionEffectType.SLOW_DIGGING) && event.getCause().equals(EntityPotionEffectEvent.Cause.ATTACK)) {
				
				event.setCancelled(true);
			}
		}
	}
}

@@ -198,16 +198,108 @@
 ype;%0D%0A%0D%0A
+//This file disables elder guardians from giving mining fatigue within 100 blocks of spawn%0D%0A
 public c
@@ -428,16 +428,64 @@
 ent) %7B%0D%0A
+%09%09//If entity is less than 100 blocks from spawn
 %0D%0A%09%09if (
@@ -581,16 +581,95 @@
  %3C= 
-2
+1
 00) %7B%0D%0A
+%09%09%09//If potion equals mining fatigue and the event is from the %22attack%22 cause%0D%0A
 %09%09%09i
@@ -802,20 +802,34 @@
 CK)) %7B%0D%0A
-
 %09%09%09%09
+//Cancel event
 %0D%0A%09%09%09%09ev

Update PotionEffectListener.java