static void setTimeout(Runnable runnable, int delay){
new Thread(() -> {
try {
Thread.sleep(delay);
runnable.run();
}
catch (Exception e){
System.err.println(e);
}
}).start();
}
@Override
protected void castSpell(World world, EntityPlayer player, BasicWand wand) {
double x = player.posX;
double y = player.posY;
double z = player.posZ;
setTimeout(() -> world.newExplosion(player, x, y, z, 10.0F, true, true), 1000);
}
by executing this piece of code I get an error:java.util.ConcurrentModificationException: null
Im just looking for triggering an explosion where the player was standing a second ago.
thanks