Health scaling plugin, a few lines of code?

Discussion in 'Archived: Plugin Requests' started by Terikan, Feb 20, 2014.

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

    Terikan

    Saw this in another topic

    Code:
            event.getPlayer().setHealthScale(60);
            event.getPlayer().setHealthScaled(true);
    I changed it to 60, to allow 3 rows of hearts (hopefully). Would also like it to only trigger if player maxhealth is > 60. If 60 or under, no scaling necessary.

    Also a /health command players can use to check health/maxhealth, and possibly a small scoreboard positioned above 3 rows of hearts + armor that displays health and max health when taking damage would be a very cool bonus.

    Don't need permissions, but can include if you like to do that for all plugins. If a config is necessary it would be just to change the number 60, which would affect the threshold and scaling. Might be nice to have it in case I decide I don't like 3 rows of hearts, or more importantly my players want a change.

    Can someone compile this for me?
     
  2. Offline

    Monkeyboystein

    Ok. Ok. Ok. Ok. 1) If you are asking for help, wrong section.
    2) You can not increase the # of hearts you have. You can use absorbtion but that would be golden hearts.
     
  3. Offline

    timtower Administrator Administrator Moderator

    2: Yes you can: http://dev.bukkit.org/bukkit-plugins/lore-attributes/
     
    reider45 likes this.
  4. Offline

    JBoss925

    Monkeyboystein
    Lol yes you can. My current plugin version has a thing that sets your max health to 50 hearts and actually shows 50 hearts.
    Terikan
    Do you only want this code in it? Because I can easily do that. And is there any certain way you want it triggered? And I could possibly do a scoreboard. Whether I could position it above the hearts is a question but I could look into it. Is this for a public server or private use? If public I'd like to see the plugin once you add it if possible :).
     
  5. Offline

    LordDarthBob

  6. Offline

    Terikan

    Do you only want this code in it? Because I can easily do that. And is there any certain way you want it triggered? And I could possibly do a scoreboard. Whether I could position it above the hearts is a question but I could look into it. Is this for a public server or private use? If public I'd like to see the plugin once you add it if possible :).[/quote]

    JBoss925 I already have a plugin in place that lets players increase their max health permanently, so once they get to 60 I want to stop additional display hearts. But also don't want it to scale until they get up to 60+. So as far as triggering, it should be always on as long as they have over 60 health, or 60 can be an XX variable set in a config file as well.

    The scoreboard position isn't all that important as long as it doesn't take up much space, and only displays for a few seconds after getting hit or by typing in a /myhp type command.

    But yes this is all I need it to do. And my server is just me and 3 people I know IRL, but you could def come check it out. I'd have to manually give you over 60 health though lol, cause otherwise it would take you quite a while to see it do anything.

    Edit: I'm leaning towards 40 for scaling now, so a config for XX for scaling would be a good investment, as it's possible I'll flip flop all over, maybe even back down to 20 if the scoreboard is useful enough.
    Edit2: Due to plugin/mod compat, I'm on 1.6.4 if that makes a diff.
     
  7. Offline

    Terikan

    Alright still looking for some help with this. Will settle for
    event.getPlayer().setHealthScale(40);
    event.getPlayer().setHealthScaled(true);

    On all the time with pretty much any method, chat or scoreboard, for a player to keep track of max health.
     
  8. Offline

    Monkeyboystein

    I mean physical hearts, you can not increase the red hearts,i believe its only golden hearts
     
  9. Offline

    Terikan

    sigh, yes you can. I'm already doing it.
     
  10. Offline

    LordDarthBob

    Monkeyboystein
    A potion effect called Absorption does, in fact, add golden hearts to your health bar, that, when damaged, do not come back. However, if you read the minecraft wiki page from the link in my previous post, you would also see an effect called Health Boost. Health boost actually adds real red hearts to your health bar for as long as the potion effect lasts, with 2 more hearts added for every additional level of potency the potion is. Just try using the /effect command on yourself to test the effects of the potion, and you'll see how it works.
     
  11. Offline

    Terikan

    You also automatically get more hearts the higher your max health. My current character has 13 hearts at 26 permanent max health.
     
  12. Offline

    Monkeyboystein

    Incredibly sorry. Did not mean to seem arrogant, i looked through and didnt see the health boost. Sorry!
     
  13. Offline

    LordDarthBob

    Monkeyboystein
    No, that's totally okay. I was just trying to be clear about what I meant. The two potions had the same effect image and similar descriptions, so they can be understandably easy to miss. :cool:
     
  14. Offline

    ThePassingStar

    Terikan
    What health modification plugin are you currently using?
    Also, what are you asking for in the OP? If I understand correctly, you want the actual health of players to vary but the visual scaling is always to 3 rows of hearts?
     
  15. Offline

    Terikan

    sorry for the late reply. I use powerNBT to modify the max health value in players dat. I don't recall exactly what the attribute is called, but there are several that are interesting besides health.

    And yes that's what I want. If possible I actually think I'd rather it be 1 row of hearts, or configurable per player such as /healthrows 1-5

    The example in OP is a cut and paste from another topic where I assume that was just how it's coded, I'm surprised no one has made anything like this yet, at least not publicly available.

    Been using skript, may have to simulate more health by reducing damage. I'll give it at least a few days or until I get bored. Would greatly appreciate this though.
     
  16. Offline

    Terikan

    Am I imagining that health scaling is possible or no one really wants to do this at all?
    If anyone does, the default 10 hearts works for scaling, I don't think any more detail than that is beneficial. Final Answer. :p Thanks.
     
  17. Offline

    Kilovice

    It is in-fact possible to give them more hearts than they normally have, it is a glitch within craftbukkit, I believe. If memory serves, if you give them health boost 2 then get their max health and set that as their max health then remove the effect they should have the extra hearts, it may have been patched, however.
     
  18. Offline

    mrCookieSlime

    Kilovice
    The thread is over 7 months old...
    Also, there is no glitch in Bukkit for this necessary...
    Bukkit adds the method player.setMaxHealth();
     
  19. Offline

    eyamaz

    -Insert something witty bout the dead and this post-

    I haven't had my coffee yet. Thread locked.
     
    timtower likes this.
Thread Status:
Not open for further replies.

Share This Page