Answers for "Iterate through a player's current chunk in minecraft forge"

0

Iterate through a player's current chunk in minecraft forge

EntityPlayer player = Minecraft.getMinecraft().player;
World world = player.getEntityWorld();
Chunk chunk  = world.getChunkFromBlockCoords(player.getPosition());

for ( double x = 0; x <= 15; x++) {  
	for( double y = 0; y <= 255; y++ ) {
		for( double z = 0; z <= 15; z++ ) {
      
			BlockPos actualPosition = new BlockPos(x,y,z);
           	IBlockState state = chunk.getBlockState(actualPosition);
      		//do stuff
      		
    	}
  	}
}
Posted by: Guest on March-17-2022

Code answers related to "Iterate through a player's current chunk in minecraft forge"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language