Kind of stupid question, but just answer it :/

Discussion in 'Plugin Development' started by Plazmotech, May 24, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    Plazmotech

    Hey, I have this code:

    Code:
        public void onPlayerInteract(PlayerInteractEvent event) {
            final Action action = event.getAction();
           
            if (action == Action.LEFT_CLICK_BLOCK) {
               
            }
        }
    How do I know WHERE this player left clicked? Thanks!
     
  2. Offline

    TheTrixsta

    theres a getBlockClicked(); method so just after your if statement add

    int X = e.getClickBlock.getLocation().getBlockX();
    int Y = e.getClickBlock.getLocation().getBlockY();
    int Z = e.getClickBlock.getLocation().getBlockZ();
    e.getPlayer().sendMessage(X+", "+Y+", "+Z);

    EDIT: Also use and remove your "final Action action = event.getAction();"

    if (e.getAction() == Action.LEFT_CLICK_BLOCK){
    }
     
Thread Status:
Not open for further replies.

Share This Page