Solved Teleport while the player is death

Discussion in 'Plugin Development' started by Badwolf330, Jan 23, 2016.

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

    Badwolf330

    hey, i neet help with something, if i remove the world and a player is death. i can't teleport the player if he has a respawn screen.... does somebody knows a way to remove the respawn screen wen i teleport a player?

    Sorry for my bad english.....
     
  2. Offline

    timtower Administrator Administrator Moderator

    @Badwolf330 Stop the player from dying, teleport, kill anyways.
     
  3. Offline

    Badwolf330

    @timtower the player shoot die... after 10 sec (on the respawn screen) it have to teleport the player.... any ideas?
     
  4. Offline

    Xerox262

    Delayed task that runs after 10 seconds setting the player's health then teleporting them
     
  5. Offline

    timtower Administrator Administrator Moderator

    @Badwolf330 Removing the respawn screen requires packets. These are not packets that I know.
     
  6. Offline

    Badwolf330

    @Xerox262 allready did tried that....

    without the delay task it works but with it isn't setting the healt....

    @timtower how is cubecraft doing this than?
     
  7. Offline

    Xerox262

    Setting a player's health to at least 1 heart removes the respawn screen.

    Edit: @Badwolf330 Did you set the health first? That's what removes the respawn screen.
     
  8. Offline

    Badwolf330

    @Xerox262 first the health like this

    Code:
    player.setHealth(20);
    player.teleport(new Locati.......)
    
     
  9. Offline

    timtower Administrator Administrator Moderator

    Packets, but they have people that know those specific packets and how to use them.
     
  10. Offline

    Badwolf330

    @timtower so the only thing i can do is remove the death screen???
     
  11. Offline

    timtower Administrator Administrator Moderator

    Not something you should ask me.
     
  12. Offline

    Badwolf330

    @timtower is there maby a way to let player join and leave the game?
     
  13. Offline

    timtower Administrator Administrator Moderator

    Did you pay attention to what @Xerox262 said?
     
  14. Offline

    Badwolf330

    @timtower did alrady tried that..... isn't working...
     
  15. Offline

    timtower Administrator Administrator Moderator

    @Badwolf330 There is a packet out there that removes the respawn screen, I just don't know which one it is.
    I can't help you with this.
     
  16. Offline

    Xerox262

  17. Offline

    Badwolf330

    @Xerox262 i'm really stupit! thanks for your help... i think i will get it working :)

    Code:
    
                              CraftPlayer cp = (CraftPlayer) p;
                              EnumDifficulty dif = EnumDifficulty.PEACEFUL;
                              EnumGamemode gm = EnumGamemode.ADVENTURE;
                                PacketPlayOutRespawn packet = new PacketPlayOutRespawn(0, dif, WorldType.NORMAL, gm);
                             cp.getHandle().playerConnection.sendPacket(packet);
    
    what are i'm doing wrong?

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

    BobTheHamster9

    If you are using spigot you can simply use
    Player.spigot().respawn();
    However I believe you could also use PacketPlayInClientCommand, I have used it before but I am not sure if it is compatible with 1.8
     
  19. Offline

    87pen

    Hey, would it be possible to avoid packets by getting when an entities damaged, checking if the FinalDamage > players current health. Drop all his items in his inventory and then teleport them somewhere?
     
  20. Offline

    Xerox262

    He wants the respawn screen for 10 seconds, after that he wants to respawn them, unless I misunderstood.
     
  21. Offline

    87pen

    @Xerox262 I was asking for my own reference. I was not answering anyone.
     
  22. Offline

    Zombie_Striker

Thread Status:
Not open for further replies.

Share This Page