From a3b5f969eddb6dc04be4f60254431fe9e4004a32 Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 16 May 2018 20:44:58 -0400 Subject: [PATCH] WitchThrowPotionEvent Fired when a witch throws a potion at a player --- .../world/entity/monster/Witch.java.patch | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/paper-server/patches/sources/net/minecraft/world/entity/monster/Witch.java.patch b/paper-server/patches/sources/net/minecraft/world/entity/monster/Witch.java.patch index 9c695872d5..617d50b281 100644 --- a/paper-server/patches/sources/net/minecraft/world/entity/monster/Witch.java.patch +++ b/paper-server/patches/sources/net/minecraft/world/entity/monster/Witch.java.patch @@ -17,3 +17,17 @@ } this.gameEvent(GameEvent.DRINK); +@@ -231,6 +237,13 @@ + ServerLevel worldserver = (ServerLevel) world; + ItemStack itemstack = PotionContents.createItemStack(Items.SPLASH_POTION, holder); + ++ // Paper start - WitchThrowPotionEvent ++ com.destroystokyo.paper.event.entity.WitchThrowPotionEvent event = new com.destroystokyo.paper.event.entity.WitchThrowPotionEvent((org.bukkit.entity.Witch) this.getBukkitEntity(), (org.bukkit.entity.LivingEntity) target.getBukkitEntity(), org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(itemstack)); ++ if (!event.callEvent()) { ++ return; ++ } ++ itemstack = org.bukkit.craftbukkit.inventory.CraftItemStack.asNMSCopy(event.getPotion()); ++ // Paper end - WitchThrowPotionEvent + Projectile.spawnProjectileUsingShoot(ThrownPotion::new, worldserver, itemstack, this, d0, d1 + d3 * 0.2D, d2, 0.75F, 8.0F); + } +