How toSpawn a fishing hook with a Lead

Discussion in 'Plugin Development' started by CorePvP, Nov 9, 2013.

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

    CorePvP

    Hey,

    i want a plugin where you can spawn a Fishing hook by leftclicking it.

    Here is my code:

    @EventHandler
    private void onClick(PlayerInteactEvent e) {
    Player p=e,getPlayer();
    if(e.getAction()==Action.LEFT_CLICK_BLOCK||e.getAction==Action.LEFT_CLICK_AIR) {
    if(p.getItemInHand().getType()==Material.LEASH) p.launchProjectile(Fish.class));
    }
    }
    }
     
  2. Offline

    GusGold

    CorePvP
    There is an typo with your event, it should be 'PlayerInteractEvent', and e,getPlayer() should be e.getPlayer(), but other than that, what are the errors you are getting, what does and doesn't work?
     
  3. Offline

    dillyg10

    There was a post about this earlier -
    Bukkit doesn't let you spawn in a fishing hook, you will have to spawn it in with NMS.
     
Thread Status:
Not open for further replies.

Share This Page