Plugin puts health on exp level

Discussion in 'Archived: Plugin Requests' started by TheKingFalu, Jan 8, 2014.

  1. Offline

    dturner699

    timtower
    How would you do this? I can set the max health but it shows a bunch of hearts instead of 10 which sucks..
     
  2. Online

    timtower Administrator Administrator Moderator

    player.setHearthScale(<scale>) ( I believe )
     
  3. Offline

    TheKingFalu

    You should stop the hearts to 10 so that even increasing them in any way (es with a string +100 health in an item) but increases in the levels of EXP ( the actually hp ) but not in the hearts.
    dturner699 Please, send me the folder whit the file you have used for create this Plugin ( for fix if they create problem whit another Plugin ) thanks.
     
  4. Offline

    dturner699

    TheKingFalu
    I know, I tried that before but the problem is I make it so that if your exp = 0 you die, but the problem is that you don't start with a level by default so you keep dying.

    TheKingFalu
    Done, I got it all to work for you!!!!
    <Edit by Moderator: Redacted mediafire url>
    It lets you go to as much exp as you want (keeps your health at 20) then when a player takes damage they will keep their health but have it removed from their exp instead!

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

    TheKingFalu

    dturner699
    I've test it but dont work...
    They show me 20 level ( the default health ) but if i wear an armor +tot health the level dont increase ( remain 20 ) but the hearts increase... I want the level increase but not the hearts.
    So, try to fix it please.
     
  6. Offline

    dturner699

    TheKingFalu
    That's not my plugin...lol mine just makes exp...if you want that you need the armor to add to their exp....it works.

    TheKingFalu
    I'm not going to help you anymore after this, after all it seems you just want to copy another server. I could do this, but it would take a while (using configs) and I'm not sure that I really want to...I will try though.

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

    TheKingFalu

    dturner699
    I dont want to copy a server but only bring a plugin idea to put in my server. I appreciate your work for me and i believe you can fix the heart increase and the armor bonus work :)
    For help you, its not obligatory put the heart in the level bar but you can put heart in this bar http://dev.bukkit.org/bukkit-plugins/bar-api/ :)
     
  8. Offline

    dturner699

    TheKingFalu
    My only problem is making the armor give stats, because it will take a long time to get all the items and the config. I'll try my best though! Just give me a few days.
     
  9. Offline

    TheKingFalu

    dturner699
    Yes, the final thing to make is the armor stats, if you make this and work your work is finish :)
    I appreciate your continue work ;)
     
  10. Offline

    chunkaymonkay

    @dturner699
    can i have the source to this plugin i can make the armor with the custom stats and all but i just need to know what stats and what they do and the source of this plugin so i can add all of the armor stats to it

    @dturner699
    why would you need a plugin that adds xp? when you kill mobs you already get Xp so this plugin was kinda pointless

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

    TheKingFalu

    chunkaymonkay
    You dont know... I want a plugin puts health in the xp level ( the exp level is disabiling ) because if i have an Armor whit too much health they show me a lot of hearts but if the hearts show ( like numbers ) in the xp level is too much comfortable. I want it for my mmorpg server :)
     
  12. Offline

    dturner699

    chunkaymonkay
    The armor adds to the level....you aren't supposed to be enchanting or getting it from zombies, etc...lol

    TheKingFalu
    Here is the code if this helps:

    Code:java
    1. package me.dturner699.HealthAsExp;
    2.  
    3. import org.bukkit.Bukkit;
    4. import org.bukkit.entity.Entity;
    5. import org.bukkit.entity.Player;
    6. import org.bukkit.event.EventHandler;
    7. import org.bukkit.event.Listener;
    8. import org.bukkit.event.entity.EntityDamageEvent;
    9. import org.bukkit.event.player.PlayerJoinEvent;
    10. import org.bukkit.event.player.PlayerRespawnEvent;
    11. import org.bukkit.plugin.java.JavaPlugin;
    12.  
    13. public class HealthAsExp extends JavaPlugin implements Listener{
    14.  
    15. public void onEnable(){
    16. Bukkit.getPluginManager().registerEvents(this, this);
    17. }
    18.  
    19. @EventHandler
    20. public void onDamage(EntityDamageEvent e){
    21. if(e.getEntity() instanceof Player){
    22. double damage = e.getDamage();
    23. Entity ent = e.getEntity();
    24. final Player p = (Player) ent;
    25. p.setLevel(p.getLevel() - (int) damage);
    26. Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable(){
    27. public void run(){
    28. if(p.getLevel() < 1){
    29. p.setHealth(0);
    30. }
    31. }
    32. }, 1L);
    33. }
    34. }
    35.  
    36. @EventHandler
    37. public void onPlayerJoin(PlayerJoinEvent e){
    38. Player player = e.getPlayer();
    39. player.setHealth(20);
    40. if(player.getLevel() < 1){
    41. player.setLevel(1);
    42. }
    43. }
    44.  
    45. @EventHandler
    46. public void onPlayerRespawn(PlayerRespawnEvent e){
    47. final Player pe = e.getPlayer();
    48. pe.setHealth(20);
    49. Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable(){
    50. public void run(){
    51. if(pe.getLevel() < 1){
    52. pe.setLevel(1);
    53. }
    54. }
    55. }, 1L);
    56.  
    57. }
    58.  
    59. }
    60.  


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

    chunkaymonkay

    oh ok so its a hp bar basically? that you can get your hp up by getting armor with more health ? if it is then i have the perfect plugin for that

    @dturner699
    keep getting lines on the p.setHealth

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

    TheKingFalu

    chunkaymonkay
    Its a Plugin for show total health in the xp level.
     
  15. Offline

    chunkaymonkay

    OK yeah I can make this for you when done I'll send u link
     
  16. Offline

    TheKingFalu

    chunkaymonkay
    Thanks a lot for your interesting in this plugin :)
    Remember, the health in the exp level increase and the heart increase too but don't show there.
     
  17. Offline

    rfsantos1996

    Wait, what this request is all about? Isnt just put on the exp bar your hp scale? I didnt understood this :l

    If im right, on damage/join/gamemode change, just divide the health by the max health and multiply by 1.0d
     
  18. Offline

    TheKingFalu

    dtuner has just puts the health on the xp bar but there is a bug... If you add a Lore into an armor and wear this the EXP LVL increased but the HEART increased too... So i want the EXP LVL increased but the HEARTS no.
     
  19. Offline

    TheKingFalu

  20. Offline

    chunkaymonkay

    ok so i think i found why the when you add a lore it goes up ill fix but i also found another bug when you take damage you dont regan

    @TheKingFalu
    what are u using to add the health or lore?

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

    Garris0n

    An idea from a server, thus copying it...
     
  22. Offline

    TheKingFalu

  23. Offline

    chunkaymonkay

    TheKingFalu
    ill go check those plugins out to see what is making it add more health

    @TheKingFalu
    how do u add health to the armor using loreatributes

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

    TheKingFalu

  25. Offline

    chunkaymonkay

    here instead of itemlorestats use this http://dev.bukkit.org/bukkit-plugins/rpg- items-2/files/4-rpgitems2-v3-4/

    Woops link doesn't work

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

    TheKingFalu

  27. Offline

    TheKingFalu

  28. Offline

    TheKingFalu

  29. Offline

    TheKingFalu

  30. Offline

    TheKingFalu

Share This Page