22 lines
1.3 KiB
Diff
22 lines
1.3 KiB
Diff
--- a/net/minecraft/world/entity/monster/EntitySkeletonAbstract.java
|
|
+++ b/net/minecraft/world/entity/monster/EntitySkeletonAbstract.java
|
|
@@ -209,7 +209,17 @@
|
|
World world = this.level();
|
|
|
|
if (world instanceof WorldServer worldserver) {
|
|
- IProjectile.spawnProjectileUsingShoot(entityarrow, worldserver, itemstack1, d0, d1 + d3 * 0.20000000298023224D, d2, 1.6F, (float) (14 - worldserver.getDifficulty().getId() * 4));
|
|
+ // CraftBukkit start
|
|
+ org.bukkit.event.entity.EntityShootBowEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callEntityShootBowEvent(this, this.getMainHandItem(), null, entityarrow, net.minecraft.world.EnumHand.MAIN_HAND, 0.8F, true);
|
|
+ if (event.isCancelled()) {
|
|
+ event.getProjectile().remove();
|
|
+ return;
|
|
+ }
|
|
+
|
|
+ if (event.getProjectile() == entityarrow.getBukkitEntity()) {
|
|
+ IProjectile.spawnProjectileUsingShoot(entityarrow, worldserver, itemstack1, d0, d1 + d3 * 0.20000000298023224D, d2, 1.6F, (float) (14 - worldserver.getDifficulty().getId() * 4));
|
|
+ }
|
|
+ // CraftBukkit end
|
|
}
|
|
|
|
this.playSound(SoundEffects.SKELETON_SHOOT, 1.0F, 1.0F / (this.getRandom().nextFloat() * 0.4F + 0.8F));
|