Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @EventHandler
- public void onPlayerInteract(PlayerInteractEvent e) {
- Player p = e.getPlayer();
- World w = Bukkit.getWorld(getConfig().getString("enabledworld"));
- if (p.getWorld() == w) {
- if (e.getAction() == Action.RIGHT_CLICK_AIR || e.getAction() == Action.RIGHT_CLICK_BLOCK) {
- if(p.getItemInHand().getType() == Material.MUSHROOM_SOUP) {
- if(p.getHealthScale() < 15) {
- p.setHealth(p.getHealthScale() + 5);
- p.getItemInHand().setType(Material.BOWL);
- }
- if(p.getHealthScale() >= 15) {
- p.setHealth(20);
- p.getItemInHand().setType(Material.BOWL);
- }
- }
- return;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement