Closed Dalez closed 9 years ago
Hey @Dalez you can do this using the GetBlockPos and GetBlock, I don't think a specific helper function is needed though because it's not that common a use case. You can use GetBlockPos with a raycast to get the position of the block you're pointing at and then in a for loop get all the blocks around it. Here's a gist that might do what you're wanting: https://gist.github.com/AlexSTV/2f061e0b1ebdb0581132
Awesome! I did think that there was a way to do it, but I couldn't figure it out (as it wasn't getting the correct values for some reason).
I'll use the code above and see if this is suitable. Thanks!
I'm not sure if there is this feature already, but it would be a good feature to check what blocks are free around a certain block. For instance, if you Raycast onto a block, it would return the blocks next to it that would be free. For example: xxx xBx xyy
B = Block x = There is no block here (well, there is air) y = There is a block here
It would be cool to have a feature for only "air" and also to return all blocks. You could then check if the block is free, and add a block next to it (I'm planning on this for farming).
Would be nice to have this with the random update/schedule system that is being made now too.