How to perform an other command?

Discussion in 'Plugin Development' started by ThrustLP, Mar 4, 2014.

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

    ThrustLP

    Hello!

    My code is:

    Code:java
    1. Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "say hello");


    Ingame the command isn't performed and there aren't any errors.
    What is wrong?

    Thank you!
     
  2. ThrustLP
    How and where are you calling the method?
     
  3. Offline

    ThrustLP

    Assist
    I've marked it

    Code:java
    1. if(votes1 == 5 && votes2 == 5){
    2. //hier den PVPON Command
    3. Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "broadcast " + ChatColor.GREEN + "PvP wurde AKTIVIERT");
    4. Bukkit.getScheduler().scheduleSyncDelayedTask(this,new Runnable() {
    5.  
    6. @Override
    7. public void run() {
    8.  
    9. //commandPVPOFF
    10. //HERE
    11. Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "broadcast " + ChatColor.GREEN + "PvP wurde DEAKTIVIERT! /krieg um erneut zu voten");
    12.  
    13. }
    14.  
    15. }, 7200*20L);
    16. return true;
    17.  
    18. }
    19. else{
    20. return true;
    21.  
    22. }
     
  4. Offline

    Minecrafter_NL

    thats not a method, thats somewhere in the code where you let it run.
    a method is something like onCommand() or onPlayerMoveEvent().
    also, /broadcast is an essentials command. make sure you have essentials installed on the server you are testing this plugin on EDIT:
    plus, you are delaying it for 7200 seconds, maybe you just have to wait a bit longer xD
     
  5. Offline

    ThrustLP

Thread Status:
Not open for further replies.

Share This Page