#718: Add consumed item, hand and consumeItem boolean to EntityShootBowEvent

By: Parker Hawke <hawkeboyz2@hotmail.com>
This commit is contained in:
CraftBukkit/Spigot
2020-08-31 18:39:12 +10:00
parent 393115aca2
commit 5d37d3d19d
4 changed files with 11 additions and 8 deletions

View File

@@ -5,7 +5,7 @@
entityarrow.shoot(d0, d1 + d3 * 0.20000000298023224D, d2, 1.6F, (float) (14 - this.world.getDifficulty().a() * 4));
+ // CraftBukkit start
+ org.bukkit.event.entity.EntityShootBowEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callEntityShootBowEvent(this, this.getItemInMainHand(), entityarrow, 0.8F);
+ org.bukkit.event.entity.EntityShootBowEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callEntityShootBowEvent(this, this.getItemInMainHand(), null, entityarrow, EnumHand.MAIN_HAND, 0.8F, true);
+ if (event.isCancelled()) {
+ event.getProjectile().remove();
+ return;