PlayerDeath / NMS Question

Discussion in 'Programming' started by Arvnar, Apr 29, 2017.

  1. Hello, I am now programming an egewisse time: D and would have a question about the PlayerDeath event. Before I was a beginner and I wanted to program an automatic respawn, I had the problem that only the player with the current Minecraft version (with which I programmed) could use the automatic respawn. Therefore, I am at any time with NMS set apart. It was pointed out today that the code ccc also works. Can not test it at the moment. Villeicht can you give me ne answer :)
    Best regards Arvnar
  2. Hello,
    So, you want to do an automatic respawn but for all version ?
    Code (Text):
    String version = Bukkit.getServer().getClass().getPackage().getName().replace(".", ",").split(",")[3];

    class = Class.forName("net.minecraft.server." + version + ".className");
    This code is to get a class, according to the version.
    • Agree Agree x 1
  3. plr.spigot().respawn();
    Should respawn the player no NMs needed

    Sent from my iPhone using Tapatalk
    • Informative Informative x 2
  4. Oke thanks :3