Added a check to make sure the chunk is loaded before spawning an entity