Started by
Litleck
on
Topic category: Advanced modding
Hello,
So I have created this function which randomly places a block in a specified range.
This gets blocks randomly placed in a cube of 4 blocks away from the center point. How would I be able to modify this so that it'll form a sphere? I would need to use sin, cos and maybe some tan?
All help will be appreciated.
The easiest way is iterating a cube (centered to the center of the sphere) that has the length of a side two times bigger than the radius of the sphere, and checking for each block in the cube if its distance from the center is less or equal to the radius.
Wouldn't it just be easier to create a schematic of a sphere thing & then just use the "Place schematic" button?
You can use the loop blocks in MCreator to achieve this the way Nuparu suggested.