I figured out why it didn't seem to work on multiplayer servers. I was checking for stone blocks in the chunk and logging that to the console. It worked fine on singleplayer but for some reason on multiplayer the chunk.getBlock() only returns air blocks and finds nothing else.
This is what I have tried:
@SubscribeEvent public void LoadChunk(ChunkEvent.Load event){
for(int x = event.getChunk().xPosition*16; x<(event.getChunk().xPosition*16)+15; x++){
for(int y = 0; y < 256; y++){
for(int z = event.getChunk().zPosition*16; z<(event.getChunk().zPosition*16)+15; z++){
if(event.getChunk().getBlock(x,y,z) != Block.getBlockById(0)){
System.out.println("Block : " + x + "," + y + "," + z);
}
}
}
}
}
This code spams my console in multiplayer. If I change getBlockById to 1 it finds nothing in multiplayer and still works in singleplayer.
Why does this happen?