From eb53a4597347d52d1d1942f8605bde866529efb7 Mon Sep 17 00:00:00 2001 From: walterhiggins Date: Wed, 9 Jan 2013 23:55:12 +0000 Subject: [PATCH] Because every mod has to have exploding arrows - amiright? --- bukkit-plugin/experimental/exploding-arrows.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 bukkit-plugin/experimental/exploding-arrows.js diff --git a/bukkit-plugin/experimental/exploding-arrows.js b/bukkit-plugin/experimental/exploding-arrows.js new file mode 100644 index 0000000..882bc93 --- /dev/null +++ b/bukkit-plugin/experimental/exploding-arrows.js @@ -0,0 +1,12 @@ +importPackage(org.bukkit.entity); +bukkit.on("entity.ProjectileHitEvent", function(listener, event){ + var projectile = event.entity; + var world = projectile.world; + // + // only want arrows shot by players to explode + // + if (projectile instanceof Arrow && projectile.shooter instanceof Player){ + projectile.remove(); + world.createExplosion(projectile.location,2.5); + } +});