Odd Exception: Ticking world entities

Discussion in 'Plugin Development' started by dark navi, Dec 9, 2012.

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

    dark navi

    EDIT: This is a know bug with CraftBukkit! Apparently, it is related to entities being teleported cross-world on death from a projectile, such as an arrow, snowball, or enderpearl.

    Please vote/comment on the following ticket to help resolve this issue!

    https://bukkit.atlassian.net/browse/BUKKIT-3222

    Hey guys, I am getting this error:
    Code:
    2012-12-09 19:53:24 [SEVERE] net.minecraft.server.ReportedException: Exception ticking world entities
    2012-12-09 19:53:24 [SEVERE] at net.minecraft.server.MinecraftServer.r(MinecraftServer.java:581)
    2012-12-09 19:53:24 [SEVERE] at net.minecraft.server.DedicatedServer.r(DedicatedServer.java:222)
    2012-12-09 19:53:24 [SEVERE] at net.minecraft.server.MinecraftServer.q(MinecraftServer.java:493)
    2012-12-09 19:53:24 [SEVERE] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:426)
    2012-12-09 19:53:24 [SEVERE] at net.minecraft.server.ThreadServerApplication.run(SourceFile:856)
    2012-12-09 19:53:24 [SEVERE] Caused by: java.lang.IndexOutOfBoundsException: Index: 622, Size: 599
    2012-12-09 19:53:24 [SEVERE] at java.util.ArrayList.rangeCheck(ArrayList.java:571)
    2012-12-09 19:53:24 [SEVERE] at java.util.ArrayList.remove(ArrayList.java:412)
    2012-12-09 19:53:24 [SEVERE] at net.minecraft.server.World.tickEntities(World.java:1216)
    2012-12-09 19:53:24 [SEVERE] at net.minecraft.server.WorldServer.tickEntities(WorldServer.java:444)
    2012-12-09 19:53:24 [SEVERE] at net.minecraft.server.MinecraftServer.r(MinecraftServer.java:577)
    2012-12-09 19:53:24 [SEVERE] ... 4 more
    2012-12-09 19:53:24 [SEVERE] Encountered an unexpected exception ReportedException
    net.minecraft.server.ReportedException: Exception ticking world entities
    at net.minecraft.server.MinecraftServer.r(MinecraftServer.java:581)
    at net.minecraft.server.DedicatedServer.r(DedicatedServer.java:222)
    at net.minecraft.server.MinecraftServer.q(MinecraftServer.java:493)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:426)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:856)
    Caused by: java.lang.IndexOutOfBoundsException: Index: 622, Size: 599
    at java.util.ArrayList.rangeCheck(ArrayList.java:571)
    at java.util.ArrayList.remove(ArrayList.java:412)
    at net.minecraft.server.World.tickEntities(World.java:1216)
    at net.minecraft.server.WorldServer.tickEntities(WorldServer.java:444)
    at net.minecraft.server.MinecraftServer.r(MinecraftServer.java:577)
    ... 4 more
    The basic set-up I have is:
    • Main world where players spawn
    • A pre-existing world is picked, copied to a directory called "current_x" (x being an integer from 0-4)
    • After the players on done on said world, they are all teleported back to the main world ("world") and the process goes until they have done 5 maps.
    • The server restarts, and the worlds ( "current_0" - "current_4" ) are deleted, so the worlds can be moved there again.
    This error is happening during step three, in which the players are all teleported back to our main world. It doesn't seem to happen after any exact number of worlds being loaded. All I can think is that somewhere entities are being deleted.​
    Any ideas?​
     
  2. Offline

    techboy291

    This would be easier to diagnose if you posted some of your code.
     
  3. Offline

    dark navi

    There's honestly too much for one post. I was just hoping someone had experienced something like this before and knew what I was doing to cause it.
     
  4. Offline

    fireblast709

    dark navi post any code that affects entities
    Code:
    [FONT=Consolas]Caused by: java.lang.IndexOutOfBoundsException: Index: 622, Size: 599[/FONT]
    My current guess is that you save the world, the world tries to save, entities despawn, saving code tries getting that entity in a for-loop
     
  5. Offline

    dark navi

    The stack trace points to somewhere within the server, not my plugin. =/

    Code:
    java.lang.IndexOutOfBoundsException: Index: 810, Size: 802
        at java.util.ArrayList.rangeCheck(ArrayList.java:571)
        at java.util.ArrayList.remove(ArrayList.java:412)
        at net.minecraft.server.World.tickEntities(World.java:1216)
        at net.minecraft.server.WorldServer.tickEntities(WorldServer.java:444)
        at net.minecraft.server.MinecraftServer.r(MinecraftServer.java:577)
        at net.minecraft.server.DedicatedServer.r(DedicatedServer.java:222)
        at net.minecraft.server.MinecraftServer.q(MinecraftServer.java:493)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:426)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:856)
    Any ideas?
     
  6. Offline

    fireblast709

    The fact that it points towards the server source, does not mean your plugin was the trigger. Looks like some code is needed
     
  7. Offline

    dark navi

    The line it throws the error on is when it loops through entities and removes dead ones. Obviously it is looping through while the number of entities is being modified. I guess I'll make sure I'm not doing any async things with entities.
     
  8. Offline

    fireblast709

    don't do any bukkit or minecraft things with async...
     
  9. Offline

    desht

    Are you using asynchronous scheduled tasks or other threads? If you're not, are there any other plugins on your server which are? (Test your plugin on a server with no other plugins installed)
     
  10. Offline

    alkarin

  11. Offline

    dark navi

    Thanks! Hopefully this will be resolved.
     
  12. Offline

    alkarin

    Hopefully, but make sure you upvote the problem or make a comment to let them know that it's not just one person. The more people that it affects the more likely they are to fix! :)
     
  13. Offline

    LaxWasHere

    "Hopefully"
     
    dark navi likes this.
  14. Offline

    dark navi

    If anyone else is experiencing this issue, PLEASE vote on the bug that alkarin posted. I'll edit the main post.
     
Thread Status:
Not open for further replies.

Share This Page