Advertisement
Guest User

Untitled

a guest
Jun 28th, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. @EventHandler
  2. public void blockInteractEvent(PlayerInteractEvent ev)
  3. {
  4. if (ev.getAction().equals(Action.RIGHT_CLICK_BLOCK)) {
  5. if ((ev.getClickedBlock().getType().equals(Material.WOODEN_DOOR)) ||
  6. (ev.getClickedBlock().getType().equals(Material.FENCE_GATE)) ||
  7. (ev.getClickedBlock().getType().equals(Material.TRAP_DOOR)))
  8. {
  9. pName = ev.getPlayer().getName();
  10. Bukkit.getServer().getScheduler()
  11. .runTaskLater(this, new Runnable()
  12. {
  13. public void run()
  14. {
  15. Main.pName = "";
  16. }
  17. }, this.delay * 20);
  18. }
  19. }
  20. if ((ev.getItem() != null) && (ev.getItem().getType() == Material.ENDER_PEARL) &&
  21. (ev.getPlayer().getName().equals(pName)))
  22. {
  23. ev.getPlayer().sendMessage(this.message);
  24. ev.setCancelled(true);
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement