diff --git a/src/main/java/com/gmail/nossr50/listeners/EntityListener.java b/src/main/java/com/gmail/nossr50/listeners/EntityListener.java index be758edce..c626c8f7c 100644 --- a/src/main/java/com/gmail/nossr50/listeners/EntityListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/EntityListener.java @@ -31,6 +31,7 @@ import org.bukkit.event.entity.EntityTameEvent; import org.bukkit.event.entity.EntityTargetEvent; import org.bukkit.event.entity.ExplosionPrimeEvent; import org.bukkit.event.entity.FoodLevelChangeEvent; +import org.bukkit.event.entity.PigZapEvent; import org.bukkit.event.entity.PotionSplashEvent; import org.bukkit.event.entity.ProjectileLaunchEvent; import org.bukkit.inventory.ItemStack; @@ -702,4 +703,11 @@ public class EntityListener implements Listener { } } } + + @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) + public void onPigZapEvent(PigZapEvent event) { + if (event.getEntity().hasMetadata(mcMMO.entityMetadataKey)) { + event.getPigZombie().setMetadata(mcMMO.entityMetadataKey, mcMMO.metadataValue); + } + } }