Want a better Minecraft server? Read about SpigotMC here!
Separate names with a comma.
Discussion in 'Spigot Plugin Development' started by Pigi0204, Jul 17, 2017.
I wanted to know how I can do if a player interacts with a particular block, a command is launched?
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).
[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?
Listen to the event and use this method: https://hub.spigotmc.org/javadocs/s.../Player.html#performCommand-java.lang.String-
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");
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
Listen for PlayerMoveEvent, check if from location is not the same as to location, get block under to location, then do your things.
ah.. ok thanks