Teleport

Discussion in 'Plugin Development' started by Tomass, Feb 7, 2012.

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

    Tomass

    Hey guys!
    How to prevent a teleports in PVP time and so took off two hearts?
    I mean a /f home (factions), /home, /spawn .
    Please help !
    Thanks in advance!
     
  2. Offline

    Slayer9x9

    Your post makes no sense. Please use proper english when asking a question.

    What I can guess is that you want a way to take two hearts off somebody who tries to teleport.
    You could just track commands, and if they match whatever you are tracking, do damage to the player.
     
  3. Offline

    Tomass

    Yes, sorry for bad Eanglish I'm from Lithuania :D
    Yes, i want take two hearts off somebody who tries to teleport (like /f home) in pvp time .
    And how to track, tell accurately please.
     
  4. Offline

    Njol

    You can either listen to PlayerCommandPreprocessEvent and check whether a player uses a teleport command, or listen to PlayerTeleportEvent and check whether it was not a PlayerPortalEvent.
    A problem with the PlayerCommandPreprocessEvent might be that you have to check whether the player actually has the permission to execute the command, so he will not be harmed without being teleported.
    The problem with PlayerTeleportEventis that it includes all teleport events, i.e. not only teleports by commands, but also nether portal teleports and maybe even when the player respawns.
    I hope you were able to understand what I wrote ;)
     
  5. Offline

    Royal_Soda

    Tomass
    Do you also want to deny the teleport or let them teleport with the 2 heart damage?
     
  6. Don't forget an instanceof EnderPearls

    Keir
     
  7. Offline

    Tomass

    Yes, you understood me !
     
  8. Offline

    Royal_Soda

    Tomass
    I was asking a question, which were you trying to do? Deny the teleport and give 2 hearts of damage? ..or allowing them to teleport with the 2 heart damage?
     
  9. Offline

    Tomass

    Deny the teleport and take 2 hearts of damage. (Like /f home, /home, /spawn)
     
  10. Offline

    Royal_Soda

    Tomass
    Do you need help with programming this or would you like it programmed for you?
     
  11. Offline

    Tomass

    Yes, please cant You programmed it for me ?
     
  12. look out whit denying the PlayerTeleportEvent because that will allow noclipp
     
  13. Offline

    Tomass

    Where can i find it ? In factions config, or its a plugin ?
     
  14. what do you mean, plz try to be more specific
     
  15. Offline

    Royal_Soda

    Tomass
    If you still want this programmed for you, I can help. But, Factions has this feature pre-installed. At least a delay.. In the config.yml
     
  16. Offline

    Tomass

    I dont have a file config.yml in factions plugin, i have a conf.json... Please help me You're my hope .
     
  17. Offline

    Sorroko

    Also you may want to consider if a player has 2 hearts and tries to teleport he will die.. which may not be what you want. (Thats a bit too harsh)
     
  18. Offline

    Royal_Soda

    Tomass
    Yes that, the config file.. Whatever the extension may be. PlayerTeleportEvent is an event. (The programming side of things)
     
  19. Offline

    Tomass

    No, I want if the player try to write "/f home" the teleportation will canceled and removed two hearts.
     
  20. Offline

    Sorroko

    I meant if the player only has 2 hearts and you remove another 2...
     
  21. the player will hve 0 heards then, and it loses his stuff, :p
     
  22. Offline

    Sorroko

    :p

    EDIT: Unecessary post, oh well :D
     
  23. Offline

    Neodork

    So someone is going to make the plugin for this poor fella ? Stop the player from teleporting upon pvp, couldn't be 2 hard... If not I'll go and the my thing...
     
  24. Offline

    Tomass

    Yes, i very very want this plugin or configuration ..

    Sorry, but I can not understand you...

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 23, 2016
  25. Offline

    Sorroko

    Hey, working on plugin now... Should have a download shortly (around half hour)

    Ok, took alot less time than I thought, here it is: http://dl.dropbox.com/u/53730212/DenyTeleport.jar
    Feature:
    Listens for '/home' '/spawn' and '/f home'
    It stops the command and gives the player 2 hearts damage.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 23, 2016
  26. Offline

    Tomass

    Thank you very much!
     
  27. Offline

    Sorroko

    No problem :p
     
  28. Offline

    Tomass

    It's not work :(
    When player just write /spawn the teleportation will canceled and removed two hearts (Not in PvP time). Please corect the plugin !!!
     
  29. Offline

    Sorroko

    Sorry I dont quite understand? when they type /spawn it is cancelled? but not when? Please explain "PvP time" :p
     
  30. Offline

    dead4y

    in this selection of forum we dont make your plugin, we just give you a tip to code it ; )
     
Thread Status:
Not open for further replies.

Share This Page