Advertisement
Guest User

Untitled

a guest
Aug 21st, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. if (event.getClickedBlock() != null &&
  2. event.getHand() == EquipmentSlot.HAND && event.getPlayer().getEquipment().getItemInMainHand().hasItemMeta() &&
  3. event.getPlayer().getEquipment().getItemInMainHand().getItemMeta().getDisplayName().equals("§bEdit tool")) {
  4.  
  5. Action action = event.getAction();
  6. Player editor = event.getPlayer();
  7. Location clickedLocation = event.getClickedBlock().getLocation();
  8.  
  9. if (action == Action.LEFT_CLICK_BLOCK) {
  10. main.setX1(clickedLocation.getX());
  11. main.setZ1(clickedLocation.getZ());
  12. editor.sendMessage("§f[§cArena PVP§f] §cP1 §f| X1 = " + main.getX1() + " | Z1 = " + main.getZ1());
  13. }
  14.  
  15. if (action == Action.RIGHT_CLICK_BLOCK) {
  16. main.setX2(clickedLocation.getX());
  17. main.setZ2(clickedLocation.getZ());
  18. editor.sendMessage("§f[§cArena PVP§f] §cP2 §f| X2 = " + main.getX2() + " | Z2 = " + main.getZ2());
  19. }
  20.  
  21. event.setCancelled(true);
  22.  
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement