Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (event.getClickedBlock() != null &&
- event.getHand() == EquipmentSlot.HAND && event.getPlayer().getEquipment().getItemInMainHand().hasItemMeta() &&
- event.getPlayer().getEquipment().getItemInMainHand().getItemMeta().getDisplayName().equals("§bEdit tool")) {
- Action action = event.getAction();
- Player editor = event.getPlayer();
- Location clickedLocation = event.getClickedBlock().getLocation();
- if (action == Action.LEFT_CLICK_BLOCK) {
- main.setX1(clickedLocation.getX());
- main.setZ1(clickedLocation.getZ());
- editor.sendMessage("§f[§cArena PVP§f] §cP1 §f| X1 = " + main.getX1() + " | Z1 = " + main.getZ1());
- }
- if (action == Action.RIGHT_CLICK_BLOCK) {
- main.setX2(clickedLocation.getX());
- main.setZ2(clickedLocation.getZ());
- editor.sendMessage("§f[§cArena PVP§f] §cP2 §f| X2 = " + main.getX2() + " | Z2 = " + main.getZ2());
- }
- event.setCancelled(true);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement