Solved java.lang.IllegalStateException: Asynchronous entity add!

Discussion in 'Plugin Development' started by BajanAmerican, Sep 13, 2013.

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

    BajanAmerican

    Code:
    2013-09-14 00:24:24 [SEVERE] java.lang.IllegalStateException: Asynchronous entity add!
    2013-09-14 00:24:24 [SEVERE] at net.minecraft.server.v1_6_R2.World.addEntity(World.java:949)
    2013-09-14 00:24:24 [SEVERE] at net.minecraft.server.v1_6_R2.World.addEntity(World.java:945)
    2013-09-14 00:24:24 [SEVERE] at org.bukkit.craftbukkit.v1_6_R2.CraftWorld.dropItem(CraftWorld.java:301)
    2013-09-14 00:24:24 [SEVERE] at me.BajanAmerican.CauldronWars.SpawnBottle.run(SpawnBottle.java:39)
    2013-09-14 00:24:24 [SEVERE] at java.lang.Thread.run(Thread.java:724)
    I am getting this error on this line:
    Code:java
    1. Bukkit.getWorld("world").dropItem(Locations.getBottleSpawn(), gl);

    I recently put this plugin on my server that is hosted by a company and this is what happened. It was working before when the plugin was running off my home-grown server. Any help? Thanks!
     
  2. Offline

    tommycake50

    Well, you added an entity from a different thread.
    More code?
     
  3. Offline

    PimpDuck

    There world probably isn't named "world".
     
  4. Offline

    BajanAmerican

    Well the thing is though, it was working 100% of the time until I switched to the new server.
    And PimpDuck
    [​IMG]
     
  5. Offline

    Janmm14

    BajanAmerican
    Never use such hard-coded string "world" for a thing that can be everything. Use getWorlds().get(0)
     
    tommycake50 and PimpDuck like this.
  6. Offline

    BajanAmerican

    How would I initiate the mehtod "getWorlds()"?
     
  7. Offline

    Pizza371

  8. Offline

    BajanAmerican

    Janmm14 PimpDuck tommycake50 Pizza371
    I am getting the same error even with the new code.. I think it is the .dropItem() method.

    Code:
    Bukkit.getWorlds().get(0).dropItem(Locations.getBottleSpawn(), gl);
     
Thread Status:
Not open for further replies.

Share This Page