Healing

Discussion in 'Archived: Plugin Requests' started by STARSLAY3r, Jan 3, 2013.

  1. Offline

    STARSLAY3r

    Hi Guys,
    So i have been posting in here for the past few days because i am getting help with plugins and people helping make those plugins and i believe this might be the last time i post in here! I need a plugin that allows players to heal each other (Just like in Minez!) using Bandages (Paper), Rose Red (Blood Bag) & the Shears to apply the ointment! I don't know how this could be done but it would have to be able so that every group in Permissions can use it! Thanks in advance
    -STAR ;D

    This plugin HAS been created! Check it out here --> http://dev.bukkit.org/server-mods/healing-bandages/
     
  2. Offline

    ThunderWaffeMC

    Sounds hard. So what you need is when you have the paper and the rose red in your inventory you can maybe right click and it heals yourself but uses up 1 of each item?
     
  3. Offline

    Retherz_

    Not hard, just on PlayerInteractEvent or PlayerInteractEntityEvent then if he right clicks and inhand is 1 of those and if the right clicked entity is an instanceof player make a healing effect to them and remove 1 of those items :)
     
  4. Offline

    ThunderWaffeMC

    MercilessPvP I know what to do I just don't know how to do it. I'll have to take a look.
     
  5. Offline

    Retherz_

    Here something like this should work
    Code:Java
    1. @EventHandler
    2. public void rightClick(PlayerInteractEntityEvent event){
    3. Player p = event.getPlayer();
    4. ItemStack inhand = p.getItemInHand();
    5. //if its a right click and then do if(Entity instanceof Player)
    6. if(inhand.getType() == Material.STRING){
    7. p.addPotionEffect(new PotionEffect(PotionEffectType.HEAL,(int) 20L, 10));
    8. p.sendMessage(tag+ChatColor.GOLD+" You have been healed");
    9. p.getInventory().removeItem(new ItemStack(Material.STRING, 1));
    10.  
    11. }

    Something like that and just change it
     
  6. Offline

    ThunderWaffeMC

    Alright, I'll try make the plugin then.

    STARSLAY3r I should have the plugin done in a day or two. Should I do it on right click or on command? For now I'll do it on command.

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

    STARSLAY3r

    Okay so here's an example. "Player2 Starts bleeding Player 1 has A bandage, rose red & shear he left clicks those items in that specific order and gives player2, 4 seconds of regen." but if you start bleeding you right click the paper/bandage and it uses it on yourself and heals +1.5 hearts! hopefully this is clear enough. thanks
     
  8. Offline

    ThunderWaffeMC

    Well this is what I have:

    You type the command /healingbandage and it will use up a paper and a red rose from your inventory and you must have shears to use it. Then it will heal you like the /heal or /feed command on other plugins. Maybe after I will add the feature to use it on other players. I hope this is okay. I may also add it so you can left click the player or you while holding shears and it will do the same feature but heal the other player.

    I will do that in version 1.0.1 of the plugin.

    STARSLAY3r Can we change the item from being RED_ROSE because I currently can't find a way to use a dye. Any other material will work though.

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

    mncat77 Retired Staff

    It is the item inksack with a damage value, like all dyes ( and wools and stonebricks and stuff like that ).
     
  10. Offline

    Junnesejer

    Now this is the third time I tell you how to do this, and I think in total this is going to be the fifth time somebody tells you how to do this.

    Code:
    if (player.getInventory().containsAtLeast(new ItemStack(Material.INK_SACK, 1, (short)1), 1)){
    //do stuff here
    }
    
    This will check if the player at least containt ONE red rose dye..
    Tested and confirmed! I just tested it.
     
    ThunderWaffeMC likes this.
  11. Offline

    Zoroark173

    This is exactly what is on the MineZ server. Way to be original :D
     
  12. Offline

    ThunderWaffeMC

    Junnesejer Yeah but how would I use it for removing an item:

    player.getInventory().removeItem(new ItemStack(Material.ROSE_RED, 1));

    I get errors if I change it to:

    player.getInventory().removeItem(new ItemStack(Material.INK_SACK, 1, (short)1), 1);
     
  13. Offline

    STARSLAY3r

    Yeah i know this is from Minez! The way they have it is probably the best way! I did give credit to them because they are awesome guys and i am not trying to make a "Rip off" of Minez. I am making a futuristic game in Minecraft, Minez is a Post Apocalyptic game, I am making a game set out in the Future! Just saying.

    Just a question please keep in mind i do not know Java! Would you change it to
    (Material.INK_SACK:1, 1, (short)1), 1);
    I added in the ":1" behind the "INK_SACK" because the id for rosered/reddye is ":1"!

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

    ThunderWaffeMC

    Thanks for giving it a shot but Java and Bukkit don't work like in game id's. I got it fixed so it doesn't matter now.

    Nearly finished. Wrote up the page just doing some final touches:

    http://dev.bukkit.org/server-mods/healing-bandages/

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

    Woobie

    Not even close :p
    First of all, you never checked if the clicked entity is player, nor casted it.
    With that code, whenever you right click (living) entity, the player will receive the effects.

    Edit: whoops, didn't see the message there :p
     
  16. Offline

    ThunderWaffeMC

  17. Offline

    Junnesejer

    I like your the plugins you made so far, if you need help anytime just tag me!
    I'd gladly help.
     
    ThunderWaffeMC likes this.
  18. Offline

    ThunderWaffeMC

    Thanks very much. I'm still new to Bukkit and Java and I think I'm cruising along well.
     
  19. Offline

    Junnesejer

    I'm also (very) new to Bukkit, but have been along with java for quite a while.
     
    ThunderWaffeMC likes this.
  20. Offline

    STARSLAY3r

    If i need any further help in the future may i call upon one of you guys!? You both seem friendly & nice. ;D Thanks again Thunder for all the help within the past week!
     
    ThunderWaffeMC likes this.
  21. Offline

    Hoolean Retired Staff

    Please remove the [REQ] in your title; it is unneccesary, and, quite frankly, annoying. :p
     
  22. Offline

    ThunderWaffeMC

    Hey no problem. Creating plugins is my favourite thing at the moment on the computer and I'll be doing it for a while. All I need is good ideas that haven't been taken.
     
    MrBluebear3 likes this.
  23. Offline

    STARSLAY3r

    Sure thing i'll be right on thatnas soon as i wake up in the morning! Sorry about that
     
    MrBluebear3 likes this.
  24. Offline

    ThunderWaffeMC

    STARSLAY3r If you have any other ideas/requests, I would happily love to do them.
     
  25. Offline

    STARSLAY3r

    Cool cool! I don't think i have the brain knowledge to learn Java! So any time i need a new plugin i'll msg you. ^_^ See you around
    -STAR*

    I actually have an idea for a plugin but there are currently 2 other plugins that do this! If they do not work i will msg you. It's currently 12:01am here :?

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

    ThunderWaffeMC

    Sure thing. Just message me whenever.
     

Share This Page