Bypass respawn screen

Discussion in 'Plugin Development' started by slater96, Aug 1, 2012.

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

    brord

    Sorry for the bump, but this is the newest working version for 1.7.10

    Code:java
    1.  
    2. new BukkitRunnable(){
    3. public void run(){
    4. try {
    5. Object nmsPlayer = p.getClass().getMethod("getHandle").invoke(p);
    6. Object packet = Class.forName("net.minecraft.server." + Bukkit.getServer().getClass().getPackage().getName().replace(".", ",").split(",")[3] + ".Packet205ClientCommand").newInstance();
    7. Field a = packet.getClass().getDeclaredField("a");
    8. a.setAccessible(true);
    9. a.set(packet, Class.forName("net.minecraft.server." + Bukkit.getServer().getClass().getPackage().getName().replace(".", ",").split(",")[3] + ".EnumClientCommand")).getEnumConstants()[0]);
    10.  
    11. Object con = nmsPlayer.getClass().getField("playerConnection").get(nmsPlayer);
    12. con.getClass().getMethod("a", packet.getClass()).invoke(con, packet);
    13. } catch (Throwable e) {
    14. e.printStackTrace();
    15. }
    16. }
    17. }.runTaskLater(plugin, 2L);
    18.  
     
    Lactem and KingFaris11 like this.
  2. Offline

    teej107

    brord What's wrong with just setting the player's health above 0 in a PlayerDeathEvent? That will automatically get rid of the death screen.
     
  3. Offline

    brord

    teej107 Mine also handles respawn, where setting health willl result in spawn @ current location
     
  4. Offline

    teej107

    brord
    Then teleport them to their respawn location.
     
    AoH_Ruthless likes this.
  5. Offline

    xTrollxDudex

    ...
     
    AdamQpzm likes this.
  6. Offline

    brord

    I dont get his reaction ^

    But i just like to have code which does the rest for me, forever.
    IDK about you guys, i just left the code here for others if they wanted >_>
     
Thread Status:
Not open for further replies.

Share This Page