mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 23:38:25 +01:00
WitchThrowPotionEvent
Fired when a witch throws a potion at a player
This commit is contained in:
parent
72743537f4
commit
a3b5f969ed
1 changed files with 14 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue