Guest User

Food & Saturation

a guest
Jan 29th, 2016
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. //At the top of your class
  2. HashMap<UUID, Float> saturation = new HashMap<UUID, Float>();
  3. HashMap<UUID, Integer> foodlevel = new HashMap<UUID, Integer>();
  4.  
  5. //Before a player gets blinded and requires aid
  6. saturation.put(p.getUniqueId(), p.getSaturation());
  7. foodlevel.put(p.getUniqueId(), p.getFoodLevel());
  8.  
  9. //When a player is successfully resurrected
  10. p.setFoodLevel(foodlevel.get(p.getUniqueId()));
  11. p.setSaturation(saturation.get(p.getUniqueId()));
Advertisement
Add Comment
Please, Sign In to add comment