Getting what a fishing rod hooked?

Discussion in 'Plugin Development' started by kampai, Jun 28, 2016.

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

    kampai

    Hey!
    I'm currently making a plugin where a player would cast a fishing rod and if it hits an entity (player) once the gets pulled back it would teleport the 2nd player to the 1st player.

    But here's the question, how would I detect someone pulling the rod back?
     
  2. Offline

    OTF Catastrophe

    Not entirely sure if this would work of not, but since fishing rods technically do damage to a player(Though there isn't any hearts being taken away.), couldn't you look for what's causing the target players damage? Then trace the target players damage back and look for who's causing it. Then run the function to teleport the target to the player. Would that work?
     
  3. @OTF Catastrophe
    1. Use PlayerFishEvent
    2. Check if the e.getState() is equal to CAUGHT_ENTITY
    3. Check if e.getCaught is an instance of Player
    4. Teleport to the location
     
    cococow123 likes this.
  4. Offline

    OTF Catastrophe

    Ahhh that makes more sense! Would my way of doing it work? Just wondering aha :)
     
Thread Status:
Not open for further replies.

Share This Page