Started by
ydydxhg
on
Topic category: Advanced modding
I am creating a procedure to determine if the light level of a block is less than 8, so i will place a torch to avoid mob spawning...
but it seems like the method returns the light value that the block is projecting.... e.g. get light level of a torch block is 14, and the block directly above it is 0.
what is the correct way of achieving this goal?
Check light level of location above your block (y + 1) if your block blocks light
in my particular case, its in a cave/underground where i am mining, the block above the block is mostly likely to be solid and blocking the light. which is why i need to workout whether to place a torch if:
1, i am on a solid block (x, y, z)
2, the lighting condition of the bloc (x,y,z) is too dark
my current logic (or i would like to achieve) is:
dig block (x, y, z),
check lighting condition of (x, y, z), if lighting is good, i.e. from light source from nearby torch or lava, go on
else, put a torch on top of (x, y, z), which will be air as just digged out.
Then you will need to check for light in all directions one block away from the current block
i see, thanks for the help