onPlayerDeath

Discussion in 'Plugin Development' started by Bush, Oct 9, 2011.

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

    Bush

    is there a way to delay the respawn button from popping up until someone enters a command?
     
  2. Offline

    Jogy34

    no but you can make is so that they cant do anything after they die but walk around until a command is entered.
     
  3. Offline

    Bush

    so if i were to make 3 commands can i make the respawn button's code diffrent for them
     
  4. Offline

    Jogy34

    well you can make it so that when a player dies a variable is set to true for that player and then if the player tries to do something you cancel it by checking if the variable is true then when the command is typed the variable for the player(s) is/are set to true. if you do this then the players can still walk around but cant actually interact with anything. also you could set their display name to something like "[dead] player name" so that people don't get confused as much
     
  5. Offline

    Bush

    k, but you see i'm gonna try make the plugin to teleport to nether or skylands or normal spawn on death, and thats gonna be decided by another player with rights
     
  6. Offline

    Jogy34

    i honestly don't know if you can mess with the re-spawn things because I think that is client side but I'm not 100% sure.
     
  7. onPlayerRespawn?
     
    Bush likes this.
  8. Offline

    Bush

    i'm not really sure what to use yet
     
  9. Offline

    Celeixen

    i suggest you just "jail" them for a short period of time until the admin decides which world to send them to.
     
  10. Offline

    Bush

    think i maght just do that thanx
     
  11. Offline

    Bush

    k, so i have this idea, when a player dies he gets sent to jail, but while he gets sent to jail a gui pops up for the intrusted player, where he can choose 1 of 3 options, hell, heathen, or second chance, so depending on the button pressed the player would get tp to a specific location
     
  12. Offline

    arnie231

    I think you could do this but would be depended on spout
     
  13. Offline

    Bush

    k then it won't work
     
  14. Offline

    Celeixen

    Are you sure you wanna do somthing like this? For your third plugin you will probably find it complex.

    I dont want to see you spamming the plugin development thread trying to get help either :/ well i mean i just dont want you relying on others help, do it all yourself you feel more accomplished :)
     
  15. Offline

    Bush

    well sorry i'm not as gud as you yet
     
  16. Offline

    Celeixen

    You know i didnt mean it like that...
     
  17. Offline

    Bush

    its kwl.......
     
  18. Offline

    Father Of Time

    Have you actually looked to see what values are passed in this event? I would imagine you could cancel this event and leave the person dead where they are (or teleport them to a purgatory area as youve suggested above) and then have them chose their fate via commands (/heaven /hell /redemption ).

    So for example, say the event passes 4 values (making these up, at work and don't have access to my bukkit files):
    1) player who died
    2) location they died
    3) respawn location
    4) what killed them

    You could intercept the re-spawn event, cancel it, then call a custom function you made and pass it the event variables:

    Code:
    InitiatePluginRespawn( player, deathloc, respawnloc, killer )
    
    {
    
    ...
    
    }
    Then inside your custom function handle what ever it is that you want to do with the player. For instance you could just teleport them to purgatory and handle relocating them to heaven or hell in other functions.

    Seeing as your proposed plug-in (I am familiar with the plug-in request you are inquiring about this for) relies heavily on players death and respawning I would advise you to load up eclipse and start browsing the player respawn and player death events to see what information they contain that may be useful to you.

    EDIT: The following link may prove useful to you, I know it did for me! it will link you directly to a section regarding event listeners, but the entire post is packed with amazing information regarding plug-in development.
    http://wiki.bukkit.org/HUGE_Plugin_Tutorial#Listeners
     
  19. Offline

    Bush

    thnx
     
Thread Status:
Not open for further replies.

Share This Page