Plugin category: Misc Suggested name: InstaSoup A bit about me: I'm a new server host, who is really bad at plugins. I am currently about to launch my PVP server! What I want: I want a plugin that instantly eats soups and refills your health (like on McPVP) I know there are plugins out there but they do all food. If someone could explain to me how to configure that, that would be fine to! Ideas for commands: /instasoup reload Ideas for permissions: insta.* When I'd like it by: ASAP, as I said I'm launching my server soon!
Plugin without reload command and uses node "instasoup.use", ops have permission node. Code: package tk.nekotech.instasoup; import org.bukkit.Material; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.block.Action; import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.plugin.java.JavaPlugin; public class InstaSoup extends JavaPlugin implements Listener { public void onEnable() { getServer().getPluginManager().registerEvents(this, this); } @EventHandler public void onPlayerInteract(PlayerInteractEvent event) { if (event.getAction() == Action.RIGHT_CLICK_AIR || event.getAction() == Action.RIGHT_CLICK_BLOCK && event.getPlayer().hasPermission("instasoup.use") && event.getPlayer().getItemInHand().getType() == Material.MUSHROOM_SOUP && event.getPlayer().getFoodLevel() != 20) { event.getPlayer().setFoodLevel(event.getPlayer().getFoodLevel() + 8); event.getPlayer().getItemInHand().setType(Material.BOWL); } } } If you wish to compile it manually simply use that code ^^ otherwise there is a jar at http://nekotech.tk/junk/InstaSoup.jar
Hm jamietech so the problem is that when i right-click the soup it just heals your hunger not your health can you fix that please?
The request was for instant eat not for health fix. If you want a health fix I can do that too but what level of health and hunger would you want restored when the user "eats"?
I'm sorry I meant it for you to right click with a soup and it heals your health bar. When I tested it out it didn't instantly eat it.
I'll update it... very easy to make. I have made BbySoup for you guys. It has a major bug where if your health is at 7.5 or above and you right-click mushroom soup it doesn't give you health and spams console with errors. I'll fix it tomorrow, I have to go to bed right now! You can download it <Edit by Moderator: Redacted mediafire url> EDIT by Moderator: merged posts, please use the edit button instead of double posting.
[quote uid=94887 name="JjPwN1" post=1340257]I have made BbySoup for you guys. It has a major bug where if your health is at 7.5 or above and you right-click mushroom soup it doesn't give you health and spams console with errors. I'll fix it tomorrow, I have to go to bed right now! You can download it <Edit by Moderator: Redacted mediafire url> Add check if health value is over 16, since you cannot set a players health to be above 20. Example: Code: if (e.getPlayer().getHealth() > 16) { e.getPlayer().setHealth(20); else e.getPlayer().setHealth(e.getPlayer().getHealth() + 4); Learn to solve basic code problems.
I tend to like the idea of having extra meter. I would be like the days of Contra Ah Contra, no one could beat you without those 30 lives with button combo and not know how many lives u had. Good times. Actually i like it so much http://dev.bukkit.org/server-mods/PVPmeal/ EDIT by Moderator: merged posts, please use the edit button instead of double posting.
That's not very useful. So, you're saying if people have too much health, they shouldn't be eligible to get the health? Also, do not throw offenses, please. If you read correctly, you'd see I didn't have time to fix it, as I had school early the next day.
Ummm, no, if the player has health over 16, their health will be set to 20. If not, then 2 hearts will be added.