New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ConcurrentModificationException, while spawning zombie #584

Microsamp opened this Issue Oct 31, 2017 · 2 comments


2 participants

Microsamp commented Oct 31, 2017

2017/10/31 17:01:57 [SCHWERWIEGEND] Error occurred while pulsing world world
at java.util.ArrayList.forEach(Unknown Source)
at net.glowstone.entity.GlowEntity.pulse(
at net.glowstone.entity.GlowLivingEntity.pulse(
at net.glowstone.GlowWorld.pulse(
at net.glowstone.scheduler.WorldScheduler$
at java.util.concurrent.Executors$ Source)
at Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$ Source)
at Source)

Glowstone build(compiled locally): 2017.10.0-SNAPSHOT.6ecd65a (MC: 1.12.2)
Glowstone build(official): 2017.10.0-SNAPSHOT.18a3b49

Steps to reproduce:

  1. Spawn a zombie with a spawnegg
  2. Hit the zombie(so i tried to force him to move)
  3. Wait for movements
    (4. Sometimes i timed out, after placing 2 zombies)

EDIT: Would someone please edit the title to "ConcurrentModificationException caused by zombie movements" or something similiar?


This comment has been minimized.


momothereal commented Oct 31, 2017

This is because the ArrayList in the task manager isn't concurrent, I'm not sure if fixing this would be much harder than changing the list to a Concurrent Set.


This comment has been minimized.


Microsamp commented Oct 31, 2017

Normal concurrent lists/sets don't support concurrent iterating in most cases.

So here we have to implement own synchronisation(e.g. synchronized-blocks or ReadWriteLock).

Alternative way(using Collections.synchronizedList()); Use .iterator() and call hasNext() and next() in a while loop

@momothereal momothereal added this to Ready for Development in 2017Q4 Nov 1, 2017

Microsamp pushed a commit to Microsamp/Glowstone that referenced this issue Nov 1, 2017

Microsamp added a commit to Microsamp/Glowstone that referenced this issue Nov 1, 2017

@wafflebot wafflebot bot removed the help wanted label Nov 23, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment