Need fisherman ability code!

Discussion in 'Plugin Development' started by APPLEisROP, Jan 11, 2014.

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

    APPLEisROP

    So i need code for fisherman kit ability!

    • If you get more than 20 blocks apart from hooked, it will unhook
    • If Fisherman changes away from fishingrod, it will unhook
    • If hooked gets hitted by someone, it will unhook
    Thanks, for any help!
     
  2. Offline

    1Rogue

    What have you tried so far?
     
  3. Offline

    HyrulesLegend

    APPLEisROP Have you tried anything so far..? Cause from the looks of it you just want us to write your code.
     
  4. Offline

    APPLEisROP

    @EventHandler

    public void onPlayerFisherman(PlayerFishEvent e) {

    final Player p = e.getPlayer();

    if(e.getCaught() instanceof Player) {

    final Player caught = (Player) e.getCaught();

    if (p.getItemInHand().getType() == Material.FISHING_ROD) {

    caught.sendMessage(ChatColor.RED+" A Fisherman Has Reeled You In!");

    p.sendMessage(ChatColor.RED+" Successfully Reeled In "+caught.getName());

    caught.teleport(p.getLocation());

    }

    }

    }



    Thats what i have made but i dont have a single idea how to make the rest
     
  5. Offline

    Garris0n

    Why are they final and what is wrong with that code?
     
  6. Offline

    APPLEisROP

    It doesnt unhook when player gets too far, its hooked until you reel in... So i need something for that
     
  7. Offline

    Doamax

    I will not feed you code unless you truly can't do it. You should get the player that is caught and the fisherman. If the distance between them is greater than 20 get the hook from the event and eject it. This will require use of the PlayerMoveEvent.
     
Thread Status:
Not open for further replies.

Share This Page