Block and Command(how do it?)

Discussion in 'Spigot Plugin Development' started by Pigi0204, Jul 17, 2017.

  1. I wanted to know how I can do if a player interacts with a particular block, a command is launched?
    #1 Pigi0204, Jul 17, 2017
    Last edited: Jul 17, 2017
  2. You specified your location to be the USA. In that case, I assume that you can speak English and therefore I will advise you to ask your question in English so it gets answered faster (since more people can understand it).
  3. [QUOTE = "Trigary, post: 2547039, membro: 350074"] Hai specificato la tua posizione per essere Stati Uniti. In questo caso, suppongo che tu possa parlare inglese e pertanto vi consiglio di fare la tua domanda in inglese in modo da ottenere risposta più veloce (dato che più persone possono capirlo). [/ QUOTE]
    Ok thanks i have translated it so now they can all understand it do you have any idea for my quest?
  4. Listen for PlayerInteractEvent, check if the action is Action.LEFT_CLICK_BLOCK or Action.RIGHT_CLICK_BLOCK, do your other type checks etc, and if it's all true use player.performCommand("command here");
  5. Ok tk now I ask: how do I do that if a player passes over a block or crosses it: portals are tapped a command
  6. Listen for PlayerMoveEvent, check if from location is not the same as to location, get block under to location, then do your things.
  7. ah.. ok thanks

Share This Page