Problem in creating a teleport GUI

Discussion in 'Plugin Development' started by KingOfMars4, Oct 1, 2019.

  1. Offline

    KingOfMars4

    Hello so im doing a plugin where u type /troll <nick> and it opens a gui of a troll plugin where u are suppose to be abble to teleport a plyer to a definied location but the problem is that when i left click the teleport button anything happens.
    Here are some prints of the in game:
    upload_2019-10-1_22-52-16.png

    And some of the code:
    upload_2019-10-1_22-55-28.png
    upload_2019-10-1_22-55-37.png
    upload_2019-10-1_22-55-49.png
     

    Attached Files:

  2. Offline

    robertlit

    In your teleportPlayer() method there is no teleportation, so of course when you click the ender pearl nothing happens. Also in the event handler you're checking for slot 1 instead of 2.
     
  3. Offline

    KingOfMars4

    but idk how to use teleportPlayer and i cant find anything in thr net.
     
    robertlit likes this.
  4. Offline

    timtower Moderator Moderator

    You made the function yourself.
    You need to teleport a player to a different player.
     
  5. Offline

    KingOfMars4

    yes i made it wrong cause i dojt want it to teleport to other person, i want it to teleport to a certain coordinate
     
  6. Offline

    timtower Moderator Moderator

    Then player.teleport(location)
     
  7. Offline

    KingOfMars4

    when i reach home im gona test thx
     
  8. Offline

    KarimAKL

    @KingOfMars4 I'd recommend looking through the javadocs for bukkit/spigot/paper (whatever you're using) the next time you need something.
     
    timtower likes this.
  9. Offline

    KingOfMars4

  10. Offline

    timtower Moderator Moderator

    @KingOfMars4 Send a message.
    Does the message show?
    What slot is being clicked?
    Is the inventory name correct?
    Why the heck are you checking if inv.getName() equals inv.getName()?
     
  11. Offline

    robertlit

    @KingOfMars4 You are checking for slot 1 when the enderpearl is in slot 2. I already mentioned that.
     
  12. Offline

    KingOfMars4

    Fixed thx everyone who helped

    how do i mark solved

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Oct 3, 2019
  13. Offline

    timtower Moderator Moderator

    Top right corner, thread tools.
    How did you fix it?
     

Share This Page