Help with Fisherman!

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

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

    APPLEisROP

    I dont know how to make it work, read description.


    So if you hook on someone, it also should show the line when its hooked. Also somekind of limit how far you can "reel in" would be awesome. Please tell how to make those things. ^

    Heres my code:

    Code:java
    1.  
    2. @EventHandler
    3. public void onPlayerFisherman(PlayerFishEvent e) {
    4. final Player p = e.getPlayer();
    5. if(e.getCaught() instanceof Player) {
    6. final Player caught = (Player) e.getCaught();
    7. if (p.getItemInHand().getType() == Material.FISHING_ROD) {
    8. caught.sendMessage(ChatColor.RED+" A Fisherman Has Reeled You In!");
    9. p.sendMessage(ChatColor.RED+" Successfully Reeled In "+caught.getName());
    10. caught.teleport(p.getLocation());
    11. }
    12. }
    13. }
    14.  
     
  2. Offline

    GaaTavares

    It should work, weird...
    OBS: add the (if e.getCaught() != null) check
     
  3. Offline

    APPLEisROP

    I added, but didnt help at all. It's okay if can fix that line thing. But i need limit for how far you can fish player.....

    I still haven't got this work, please someone help if you know how! :)

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 6, 2016
  4. Offline

    Compressions

  5. Offline

    APPLEisROP

    If you hook it to someone, it doesnt show the line. Thats not big problem... But i need something that it will unhook if hooked gets more than 20 blocks away from you. Other wise its too OP, you can hook and then run in to other side of the map or even soup! and hook is still attached. Also it should unhook if hooked gets hitted by someone, or "hooker" switch away from rod.
     
  6. Offline

    Compressions

    APPLEisROP Without changing NMS code, there's no good way to do that.
     
  7. Offline

    APPLEisROP

    I dont care if it changes, i just want code which works. :p
     
Thread Status:
Not open for further replies.

Share This Page