Note: I am not using and I will not use Skematic or FaweSK. So do not mention it.
I am trying to get the types of blocks in a region, but I am not sure how. Right now I have this function:
I am trying to figure out how to parse the loop-value as a block but haven't found a solution yet... Here is the current output of loop-value:
This should be stone, as the region is only made of stone in this example. If I were to add multiple types of blocks, they would also be like this, just with different ids.
If someone has a solution for how to parse this as an itemtype or block that would be great..
I am trying to get the types of blocks in a region, but I am not sure how. Right now I have this function:
code_language.skript:
function getBlocksInRegion(pos1: location, pos2: location) :: objects:
set {_session} to getEditSession(world of {_pos1})
set {_blocks} to {_session}.getBlockDistributionWithData(getRegion({pos1}, {pos2}))
loop ...{_blocks}:
broadcast "%loop-value%"
set {_block} to ?
#add {_block} to {_return::*}
return {_return::*}
This should be stone, as the region is only made of stone in this example. If I were to add multiple types of blocks, they would also be like this, just with different ids.
If someone has a solution for how to parse this as an itemtype or block that would be great..