Fishing Players

Discussion in 'Plugin Development' started by PHILLIPS_71, Mar 24, 2013.

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

    PHILLIPS_71

    I have tried to code this plugin that when you hook a player with a fishing rod it will launch them towards you like in single player when you hook a mob but I has not been working does anyone know the code?
     
  2. Offline

    finalblade1234

    Yea! In 1.5 there is a very easy way t do this!
    code:
    Code:
    @EventHandler
    public void onPFE(PlayerFishEvent event){
        if(!(event.getCaught() == null)){
            event.getCaught().teleport(event.getPlayer());
       
        }
       
    }
    then if you want it for just players just add a player check into it....
     
  3. Offline

    PHILLIPS_71

    Wouldn't that just tp the player to you I want the player to get pulled towards you, if you go into single player and catch a mod with a fishing rod and see how they are pulled towards you that is what I want thanks.
     
  4. Offline

    _Filip

    Make an on player fish event handler, then if the caught entity is a player, set it's velocity relative to where the fisher is.
     
  5. Offline

    Tirelessly

    if(!(event.getCaught() == null)){

    if(event.getCaught()!=null){
     
  6. Offline

    PHILLIPS_71

    swampshark19

    Sorry I'm new to this I though it would be easy but I guess not how would I do that? Thanks for the help
     
  7. Offline

    skipperguy12

    Tirelessly
    Uh, same thing lol...

    Try

    caughtplayer.setVelocity(fisherplayer.getLocation().getDirection().multiply(1));
     
  8. Offline

    PHILLIPS_71

    skipperguy12

    So this? I'm not on my computer so I can check sorry :/


    public void onPFE(PlayerFishEvent event){
    if(!(event.getCaught() == null)){
    caughtplayer.setVelocity(fisherplayer.getLocation().getDirection().multiply(1));

    }

    }
     
  9. Offline

    nitrousspark

    wouldnt it be multiply(-1)?
     
  10. Offline

    abmenzel

    How do you get the player who is fishing?
     
  11. Offline

    TheUpdater

  12. Offline

    Tirelessly

    I know they're the same thing, but that's poor coding and makes the meaning less clear.
     
Thread Status:
Not open for further replies.

Share This Page