Solved Why doesn't this work?

Discussion in 'Plugin Development' started by Alabingu, Apr 14, 2018.

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

    Alabingu

    Hi! So I am trying to do a plugin to give speed every 10 seconds and it gives me an error. :/
    Code:
    package alabingu.guanaffaop.threads;
    
    import org.bukkit.Bukkit;
    import org.bukkit.entity.Player;
    
    public class Speed implements Runnable {
    
        @Override
        public void run() {
            while(true) {
              
                for(Player all : Bukkit.getOnlinePlayers()) {
                    all.performCommand("effect @a speed 11 1");
                }
              
                try {
                    Thread.sleep(10000);
                } catch(InterruptedException e) {
                  
                }
              
            }
          
        }
      
    }
    
    Error:
    Code:
    [08:27:25 WARN]: Unknown CommandBlock failed to handle command
    java.lang.IllegalStateException: Asynchronous effect add!
            at org.spigotmc.AsyncCatcher.catchOp(AsyncCatcher.java:14) ~[spigot-1.8.8.jar:git-Spigot-21fe707-e1ebe52]
            at net.minecraft.server.v1_8_R3.EntityLiving.addEffect(EntityLiving.java:582) ~[spigot-1.8.8.jar:git-Spigot-21fe707-e1ebe52]
            at net.minecraft.server.v1_8_R3.CommandEffect.execute(SourceFile:97) ~[spigot-1.8.8.jar:git-Spigot-21fe707-e1ebe52]
            at org.bukkit.craftbukkit.v1_8_R3.command.VanillaCommandWrapper.dispatchVanillaCommand(VanillaCommandWrapper.java:93) [spigot-1.8.8.jar:git-Spigot-21fe707-e1ebe52]
            at org.bukkit.craftbukkit.v1_8_R3.command.VanillaCommandWrapper.execute(VanillaCommandWrapper.java:43) [spigot-1.8.8.jar:git-Spigot-21fe707-e1ebe52]
            at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:141) [spigot-1.8.8.jar:git-Spigot-21fe707-e1ebe52]
            at org.bukkit.craftbukkit.v1_8_R3.CraftServer.dispatchCommand(CraftServer.java:641) [spigot-1.8.8.jar:git-Spigot-21fe707-e1ebe52]
            at org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer.performCommand(CraftPlayer.java:242) [spigot-1.8.8.jar:git-Spigot-21fe707-e1ebe52]
            at alabingu.guanaffaop.threads.Speed.run(Speed.java:13) [GuanaFFAOP.jar:?]
            at java.lang.Thread.run(Thread.java:745) [?:1.8.0_112]
    
     
  2. Online

    timtower Administrator Administrator Moderator

  3. Offline

    Alabingu

    But I've never used that, could you give me an example, please? :v @timtower
     
    Last edited: Apr 15, 2018
  4. Online

    timtower Administrator Administrator Moderator

  5. Offline

    Alabingu

    Ok, thx :DDD
     
Thread Status:
Not open for further replies.

Share This Page