Skip to content
Discussion options

You must be logged in to vote

Just before getting into timers, try to use delay()'s instead of queue's for timing things. You might have seen older examples where I have used queue's but that was changed with #590 (I'll update docs soon). World queue especially shouldn't be used often as their names need to be unique or they'll override when a second player does the same action.

The issue here is:

npcTimerStop("time_till_despawn") { npc ->
    npcs.remove(npc)
    logger.warn { "TIMER TIMER STOPPED FOR NPC" }
}

Because the timer events are happening within the NPCTask, you end up trying to modify the npcs list while iterating through it, essentially:

for (npc in npcs) {
   npcs.remove(npc)
}

Which is why it results in…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@Syntax2022
Comment options

@GregHib
Comment options

Answer selected by Syntax2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants