Make an item shoot like an arrow

Discussion in 'Plugin Development' started by boardinggamer, Dec 5, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    boardinggamer

    How can I make an item (redstone dust) shoot like its an arrow?

    I want it to shoot in the direction a player is facing. please help.
     
  2. Offline

    Woobie

    Code:
        public void onInteract(PlayerInteractEvent e) {
            Player p = e.getPlayer();
            World world = p.getWorld();
                if(e.getAction() == Action.RIGHT_CLICK_AIR && p.getItemInHand().getType() == Material.STICK){
                    final Item grenade = world.dropItem(p.getEyeLocation(), new ItemStack(Material.REDSTONE));
                    grenade.setVelocity(p.getLocation().getDirection().normalize().multiply(2));
                    }
                }
     
  3. Offline

    Techtony96

Thread Status:
Not open for further replies.

Share This Page