Need help with NMS

Discussion in 'Plugin Development' started by Brendyn Todd, Jun 8, 2014.

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

    Brendyn Todd

    Greetings all,

    I've just recently picked up NMS for a plugin I am creating. I need to know how I can change a players max health using NMS.

    Is it possible and if so how can it be done?
     
  2. Offline

    St3venAU

    You shouldnt need to use NMS to set a players max health. Bukkit has a Player.setMaxHealth method. e.g.

    player.setMaxHealth(15.0);
     
  3. Offline

    MinecraftMart

    St3venAU

    But you need NMS if you want to get it above 20
    I have the same question really
     
  4. Offline

    xize

    Yea nms is not needed from my understanding its even possible to use setMaxHealth(Integer.MAX_VALUE); if I'm correct but haven't checked myself.
     
  5. Offline

    XLordalX

    If you really want to use NMS, try this:
    Code:java
    1. ((CraftPlayer)player).getHandle().getAttributeInstance(GenericAttributes.a).setValue(maxHealth);
     
  6. Offline

    Konkz

    Or give them health boost?
     
Thread Status:
Not open for further replies.

Share This Page