Advertisement
Guest User

Untitled

a guest
Oct 21st, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. @EventHandler
  2. public void PlayerOpen(final InventoryOpenEvent event) {
  3. event.getPlayer().addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, 100000, 200));
  4. }
  5.  
  6. @EventHandler
  7. public void PlayerClose(final InventoryCloseEvent event) {
  8. final Player player = (Player)event.getPlayer();
  9. for (final PotionEffect potionEffect : player.getActivePotionEffects()) {
  10. player.removePotionEffect(potionEffect.getType());
  11. }
  12. }
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement