SHARE
TWEET

ender bow

Cyborg_Gaming May 25th, 2020 1,098 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package me.hal989.slimestack;
  2.  
  3. import io.github.thebusybiscuit.slimefun4.implementation.items.weapons.SlimefunBow;
  4. import me.mrCookieSlime.Slimefun.Objects.handlers.BowShootHandler;
  5. import me.mrCookieSlime.Slimefun.api.SlimefunItemStack;
  6. import org.bukkit.Location;
  7. import org.bukkit.Sound;
  8. import org.bukkit.entity.Player;
  9. import org.bukkit.entity.Projectile;
  10. import org.bukkit.inventory.ItemStack;
  11.  
  12. public class EnderBow extends SlimefunBow {
  13.     public EnderBow(SlimefunItemStack item, ItemStack[] recipe) {
  14.         super(item, recipe);
  15.     }
  16.     @Override
  17.     public BowShootHandler onShoot() {
  18.         return (e, n) -> {
  19.             Projectile firedArrow = (Projectile) e.getDamager();
  20.             Player p = (Player) firedArrow.getShooter();
  21.             Location enemyPos = n.getLocation().clone();
  22.             Location playerPos = p.getLocation().clone();
  23.         n.teleport(playerPos);
  24.         p.teleport(enemyPos);
  25.         n.getWorld().playSound(n.getLocation(), Sound.ENTITY_ENDERMAN_TELEPORT, 1, 1);
  26.         p.getWorld().playSound(p.getLocation(), Sound.ENTITY_ENDERMAN_TELEPORT, 1, 1);
  27.         };
  28.     }
  29. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top