Hello, I would like know how to for wait à player placed block after command ? Sorry for my english, I am french. French : Je voudrais savoir comment le plugin attende l'evenement block place après une commande
Read this: http://wiki.bukkit.org/Plugin_Tutorial#Listeners It will point you where you need to go. I recommend reading the whole tutorial @ralmn
(1) In your plugin, keep a Set<String> called ready. Each String is a player name. A player is included in the set when the plugin is between the "command entered" and "block placed" conditions. (2) In your CommandExecutor method onCommand(), you mark the player as ready with ready.add(player.getName()). (3) In your BlockListener method onBlockPlace(), you see if the player is ready with ready.contains(player.getName()). If the player is in the set, then you can do your magic code here. (4) Also, when the effect wears off, you can remove the player from the set with ready.remove(player.getName()). This might be right after #3. If the effect should last for six blocks instead of one block, use a Map<String, Integer> instead. The Integer is a counter for how many more blocks are allowed, starting with 6 and counting down. Remove the player when it reaches zero. If the effect should last for ten minutes instead of one block, use a Map<String, Long> instead. The Long is a timestamp (System.getCurrentTimeMillis() + 10*60*1000) for when the effect expires. Remove the player when the current time is past the expiration time. Ma francais c'est tres mal; pardonnez moi pour le Anglais.
http://download.oracle.com/javase/1.4.2/docs/api/java/util/HashMap.html You simply use the key for the player name and the value for a block counter. You put an entry into the map when the command executes, then, every time a block is placed, you count the value till you have it to your needs and if it's there you execute your code and remove the entry from the map.
@ralmn - looks like people have tried, it's either an issue of language barrier or you simply don't understand java very well, (possibly both). It's nothing against you, but it seems like this may be something that is too difficult to accomplish.