Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @EventHandler
- public void blockInteractEvent(PlayerInteractEvent ev)
- {
- if (ev.getAction().equals(Action.RIGHT_CLICK_BLOCK)) {
- if ((ev.getClickedBlock().getType().equals(Material.WOODEN_DOOR)) ||
- (ev.getClickedBlock().getType().equals(Material.FENCE_GATE)) ||
- (ev.getClickedBlock().getType().equals(Material.TRAP_DOOR)))
- {
- pName = ev.getPlayer().getName();
- Bukkit.getServer().getScheduler()
- .runTaskLater(this, new Runnable()
- {
- public void run()
- {
- Main.pName = "";
- }
- }, this.delay * 20);
- }
- }
- if ((ev.getItem() != null) && (ev.getItem().getType() == Material.ENDER_PEARL) &&
- (ev.getPlayer().getName().equals(pName)))
- {
- ev.getPlayer().sendMessage(this.message);
- ev.setCancelled(true);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement