[REQ][Formatted][$$$]Increase/Decrease default starting health[Formatted][$$$]

Discussion in 'Archived: Plugin Requests' started by polkunus, Dec 30, 2011.

  1. Offline


    Plugin Category: General

    Suggested Name: Option A: MaxHealth Option B: KraftHealth

    About Me: I'm currently in the(for 3 months now) progress of opening a serious 125-mann server called "AfterKraft". Simply put, it's a post-apocalyptic SMP server which you explore abandoned areas to find loot and rebuild lost cities (we build all the buildings and fill them with player-unique loot). Furthermore, we focus a great amount of our efforts in PvP as well with a clan system and such, but that's not important for this topic. My issue is that I've been really busy with my site and managing the server so it would be great if someone can lend me a hand!

    What I want: I just want a plugin that can do one simple thing (at least) and that is: Increasing/Decreasing players' maximum health. The health would be configurable via YAML and that's really it. I've looked everywhere and cannot find a simple plugin that would change the health counter. The only plugins that I've seen which can change player maximum health are heroes (herocraft is having issues with 1.0 because bukkit changed the way it deals with health) and ctp (crashes instantly if you change the health value in the config)

    Ideas for Commands: Probably just "/view health" and it just displays your amount of health you have. The ability to change other people's health as a mod?

    Ideas for Perms: Other than the ability to change other people's health...I don't believe there is a need. I'm guessing all players should start out with the same amount of health regardless of rank. Again, if you want, you can add these in too.

    Bonus Idea: Increase health based on xp level.

    Willing to pay up to: I'm giving you two options:

    Option A: Call the plugin whatever you like and do what you like as long as I can customize my players' health. I don't mind what it's called and what the commands are or if you do or don't put your name on it, I just want it out there and I would like for it to work properly. In fact, have my idea, you have the rights to it completely.

    Option B: The plugin will be called "KraftHealth - Max Health". The project will be under the server's name, but will not be private (I prefer and have always admired an "open" community). The plugin will be listed in the bukkitdev site, but will have our server's name slapped on it and give credit to you (the coder). It also would be nice if you added in the "bonus" suggestion. It must 100% work on the newest bukkit and must be maintained for a reasonable amount of time. We will probably use an MIT license.

    I'm up for negotiation.

    When I'd like for it to be done: Well soon. The length of time is one of the factors in the Option "B" payout.

    Thanks for looking. Post your interest here and I guess I'll pm you from there on.

    I'm also looking for mature, experienced coders who are willing to push out open plugins for us and the bukkitdev site. Pm me for those details too, with your information and past projects of course.
  2. Offline


    Posting because I've been searching and is wondering why such a simple idea hasn't been widely done already...

    Health capacity is a rather important element for a lot of games... And yet I see about 10 health regen threads.
  3. Offline


    The reason because there's no plugin for this: The bukkit API doesn't let you do it.
    The only thing you can do with a player's health is setting it,but the normal amount,not the maximum one.
    This value can be 0-20. 1 means a half heart.
    However,i think there's two possible solutions: Spout or a lil' trick.
    The trick is you doesn't set higher the player's health (ofc,they see a higher number in the chat if they type in /view health ,but not in health bar) ,you set the amount of the damage he gets after everything.So if the "player has 200 HP" then he get only 50% damage from everything,so it's the feeling of he have twice as amount of HP.
    I hope this will help out the developer who going on it ;)
  4. Offline


    I have a working version done using that "lil' trick" stated above. It gets the health ratios right and that nice stuff, but I don't think its as configurable as you might like. Some more information is needed. How do you want players to regenerate(with food and such)? Do you want them to gain back health slowly like normal food regeneration, or do you want it to regenerate using a percentage of their "fake" total health(meaning quicker regeneration)? Also, do you want it to be globally based on xp level? or have it be integrated with permissions/configurable so that high ranks can have higher maximum health?

    I'm going to go ahead and use a global xp multiplier, since that seems like more of what you want.

    Here is the plugin! I used a global xp level multiplier and the normal Minecraft health regen. I tested it some and it works well so far. The commands are /viewhealth (player) and /sethealth [player]. (/sethealth requires the permission MaxHealth.set and does not heal, it sets the players maximum base health). No payment is necessary, as I was going to be doing this anyways. If you have any problems or bugs, or you just want something changed or added, just let me know. :)
    <Edit by Moderator: Redacted mediafire url>

    P.S. If you get an UnsupportedClassVersionError or something like that on console, let me know and I will try to compile with Java JDK6 for you.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: Nov 11, 2016
  5. Offline


    Awesome! Great. I wanted players to eat more to fill more of their hearts -- meaning that it doesn't regenerate health via percentage, but flat regeneration. So, high health players need to eat more food/potions or whatever to gain their health back.

    And for configuration I wish it would be both, if I'm asking too much you don't have to, but it would be great to have the health configurable by worlds so in pvp maps your health wouldn't be affected by xp, but in the main survival map your health would be on par with your xp. Or if that's too much work maybe just having the option to disable the xp/health ratio and increasing all players' flat health globally.

    Thanks so much! I really appreciate this! I wish you had a "donate" button D: ...

    I'm actually going to go ahead an upgrade my server's java to 7, since I'm starting to see a couple plugins with 7 as a requirement :p
    Last edited by a moderator: Nov 11, 2016
  6. Offline


    Perfect! That's what I did! ;D

    Sure thing! I will try to make some per world options! I think there is also a small bug that needs to be fixed. I will try to get an update out soon.

    Here you go! <Edit by Moderator: Redacted mediafire url>
    With this version, you should be able to set which worlds the Level Multiplier affects in the config. Just put the name of the world you wish to be affected by the multiplier in the list under Enable Multiplier. :D
    Note: I haven't tested if this works myself, but it should. I believe that it should also update itself and not have problems when a player switches worlds. Again, if you experience any problems or want something else, don't hesitate to ask me about it!

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: Nov 11, 2016
  7. Offline



    This is great, more than I expected and I can't believe you're not charging! This is awesome, I'm messing with it now!

    I updated to jdk7 and everything seems to work except that creative mode is acting a bit funky ~_~. I'm dying in creative mode? I seem to also glitch out after I die not being able to do anything :p

    Thanks again, I really appreciate your time and efforts :)

    I seem to also get this now :(

    01.01 04:45:37 [Server] INFO at net.minecraft.server.ThreadServerApplication.run(SourceFile:457)
    01.01 04:45:37 [Server] INFO at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:425)
    01.01 04:45:37 [Server] INFO at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:527)
    01.01 04:45:37 [Server] INFO at net.minecraft.server.NetworkListenThread.a(SourceFile:108)
    01.01 04:45:37 [Server] INFO at org.getspout.spout.SpoutNetServerHandler.a(SpoutNetServerHandler.java:550)
    01.01 04:45:37 [Server] INFO at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:93)
    01.01 04:45:37 [Server] INFO at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
    01.01 04:45:37 [Server] INFO at net.minecraft.server.Packet10Flying.a(SourceFile:126)
    01.01 04:45:37 [Server] INFO at org.getspout.spout.SpoutNetServerHandler.a(SpoutNetServerHandler.java:679)
    01.01 04:45:37 [Server] INFO at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:307)
    01.01 04:45:37 [Server] INFO at net.minecraft.server.EntityPlayer.a(EntityPlayer.java:223)
    01.01 04:45:37 [Server] INFO at net.minecraft.server.EntityHuman.w_(EntityHuman.java:215)
    01.01 04:45:37 [Server] INFO at net.minecraft.server.FoodMetaData.a(FoodMetaData.java:53)
    01.01 04:45:37 [Server] INFO at net.minecraft.server.EntityLiving.d(EntityLiving.java:404)
    01.01 04:45:37 [Server] INFO at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:339)
    01.01 04:45:37 [Server] INFO at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62)
    01.01 04:45:37 [Server] INFO at org.bukkit.plugin.java.JavaPluginLoader$77.execute(JavaPluginLoader.java:804)
    01.01 04:45:37 [Server] INFO at me.tomjw64.MaxHealth.MHEntityListener.onEntityRegainHealth(MHEntityListener.java:48)
    01.01 04:45:37 [Server] INFO at org.bukkit.craftbukkit.entity.CraftLivingEntity.setHealth(CraftLivingEntity.java:42)
    01.01 04:45:37 [Server] INFO java.lang.IllegalArgumentException: Health must be between 0 and 20

    edit: Looks like I'm not getting it anymore or that I'm just not noticing it on the console.. weird. Maybe it was on my end?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 22, 2016
  8. Offline


    I will check this out and the other stuff tomorrow if I have the time. :)
    That is not on your end, just so you know. :p
    I must have made an error when dealing with health regen.
  9. Offline


    Just sayin, it's occurring when a player is put in creative mode (health normally being paused by minecraft). I'm saying this because I just realized it when placing one person in creative and now just getting the same spam until the player is removed from creative mode.
  10. Offline


    Hmm... This is strange. :O Thanks for the bug report though! I think I will just check if the player is in creative, and if the player is, I will disable to plugin for them. Hopefully this should fix it.

    <Edit by Moderator: Redacted mediafire url>

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


    Last edited by a moderator: Nov 11, 2016
  12. Offline


    From what I can see on the changes, this will not need changes, but only time will tell.
    Correct, I'd like to make it somewhat stable first. If I fix this creative thing, then I will probably set up a bukkitdev.

    Do you mean that the hearts still show up on the screen? or that you simply can take damage? It would be helpful to know.

    Edit: If it was just that you were taking damage, I think that might have just fixed that now. Not sure though.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 22, 2016
  13. Offline


    Oh to answer your question...

    You simply take damage and die, sometimes it will glitch out and show you the "respawn menu" clicking it will either turn you into a "ghost"(cant even chat or type in commands) or do absolutely nothing or simply work as intended. It's really weird and results are quite inconsistent.

    I am here: http://maps.google.com/maps?ll=34.062910,-118.447658
  14. Offline


    alright! So i think i fixed some of the creative bugs. Either that or I can't replicate them after my fix. I also fixed a bug where the player doesn't die and it throws an error if a player gets damaged below 0.
    Here! <Edit by Moderator: Redacted mediafire url>

    If there are no more large errors, I think I will go ahead and try to make a BukkitDev for this plugin. Thanks for the help guys! :)
    Last edited by a moderator: Nov 11, 2016
  15. Offline


    It does hide hearts, just damage isn't ignored from anything, except fall damage
    There is something even more interesting though explained in bullet points.
    Creative mode player death from lava, drowning, mob attacks (creeper explosions, arrows and zombies):
    • Player is set with 40 health.
    • Player is then placed in creative mode (via /gamemode player 1)
    • Player builds, walks around flys, falls, nothing happens.
    • Player aggros a mob, blows up tnt, builds under water, places lava, and takes damage as if in survival.
      • There are no hearts showing, bubbles (for underwater), no sign of warning.
      • damage is being reacted like survival would be, lava= camera shakes, flames fill screen, shortly you die, water= you suffocate and can swim up thanks to flying, but do the normal thing of drowning if not flying
      • damage is taken and ignores things like like WorldGuard's /god and VanishNoPacket's vanish and CommandBook's /heal
    • Player then drops items as if died, may sometimes stay at the same place and still move freely as if they didnt' die, but the server processes them as dying, items drop, notification, coins reduced, levels lost etc.
    Survival all that changes is that /god and /vanish and /heal aren't any help if aggroing any mobs already. Damage is taken reguardless.

    I know there could be some checks done for damage and such.

    Also does it affect if I'm using PermissionsEx with ModifyWorld (it does have damage acceptance permission controls)?
  16. Offline


    This is strange, i can't replicate most of this with my most recent version. I do know though that it isn't compatible with /heal and for some reason /god(might be a priority issue). Have you tried the most recent version as well as tried to delete the old config file and old database file? If all of this persists, look for other plugins that may be modifying health, I doubt permissionsEX would cause something like that to happen.
    I don't see how this could happen though, as I don't even touch player properties after death. I simply reset health in MY database, which doesn't affect the player until I tell it to. :/

Share This Page