```
on right click on obsidian:
# SIDE CHECKING
# In this root condition, we are checking if the side of the clicked block
# is at the center. Variable {_n}, {_s}, {_w}, {_e} represents the direction of the portal
# which is equivalent to north, south, east and west. And these variable's
# are located in the center of the assumed portal.
if block 1 meter above event-block is obsidian:
if block 1 meter below event-block is obsidian:
set {_n} to blocks 2 meters north of event-block
set {_s} to blocks 2 meters south of event-block
set {_w} to blocks 2 meters west of event-block
set {_e} to blocks 2 meters east of event-block
# In this condition, we checked first the north side of the clicked obsidian to
# assess if there is an existing portal.
if block 2 meters above {_n} is obsidian:
set {_n2} to block 2 meters above {_n}
if block 1 meter north of {_n2} is obsidian:
if block 1 meter south of {_n2} is obsidian:
# If the condition has passed these conditions above. Then we can
# conclude that there are 3 obsidians above the assumed portal on
# the north side. Same thing goes below for the other sides of the
# portal.
if block 2 meters below {_n} is obsidian:
set {_n2} to block 2 meters below {_n}
if block 1 meter north of {_n2} is obsidian:
if block 1 meter south of {_n2} is obsidian:
if block 2 meters north of {_n} is obsidian:
set {_n2} to block 2 meters north of {_n}
if block 1 meter above {_n2} is obsidian:
if block 1 meter below {_n2} is obsidian:
# And lastly, if the checking reached at this bottom part
# of the checks, we can conclude that there is a REAL
# portal. Insert some code here that you want to execute.
add 1 to {_portals}
# The process here is repeated from above and the only changes are the directions.
if block 2 meters above {_s} is obsidian:
set {_s2} to block 2 meters above {_s}
if block 1 meter north of {_s2} is obsidian:
if block 1 meter south of {_s2} is obsidian:
if block 2 meters below {_s} is obsidian:
set {_s2} to block 2 meters below {_s}
if block 1 meter north of {_s2} is obsidian:
if block 1 meter south of {_s2} is obsidian:
if block 2 meters south of {_s} is obsidian:
set {_s2} to block 2 meters south of {_n}
if block 1 meter above {_s2} is obsidian:
if block 1 meter below {_s2} is obsidian:
# Insert some codes here.
add 1 to {_portals}
if block 2 meters above {_e} is obsidian:
set {_e2} to block 2 meters above {_e}
if block 1 meter east of {_e2} is obsidian:
if block 1 meter west of {_e2} is obsidian:
if block 2 meters below {_e} is obsidian:
set {_e2} to block 2 meters below {_e}
if block 1 meter east of {_e2} is obsidian:
if block 1 meter west of {_e2} is obsidian:
if block 2 meters east of {_e} is obsidian:
set {_e2} to block 2 meters east of {_e}
if block 1 meter above {_e2} is obsidian:
if block 1 meter below {_e2} is obsidian:
# Insert some codes here.
add 1 to {_portals}
if block 2 meters above {_w} is obsidian:
set {_w2} to block 2 meters above {_w}
if block 1 meter east of {_w2} is obsidian:
if block 1 meter west of {_w2} is obsidian:
if block 2 meters below {_w} is obsidian:
set {_w2} to block 2 meters below {_e}
if block 1 meter east of {_w2} is obsidian:
if block 1 meter west of {_w2} is obsidian:
if block 2 meters west of {_w} is obsidian:
set {_w2} to block 2 meters west of {_w}
if block 1 meter above {_w2} is obsidian:
if block 1 meter below {_w2} is obsidian:
# Insert some codes here.
add 1 to {_portals}
# Here the clicked block is located on the top portion of the portal side.
if block 1 meter below event-block is obsidian:
if block 2 meters below event-block is obsidian:
set {_block} to block 1 meter below event-block
set {_n} to blocks 2 meters north of {_block}
set {_s} to blocks 2 meters south of {_block}
set {_w} to blocks 2 meters west of {_block}
set {_e} to blocks 2 meters east of {_block}
if block 2 meters above {_n} is obsidian:
set {_n2} to block 2 meters above {_n}
if block 1 meter north of {_n2} is obsidian:
if block 1 meter south of {_n2} is obsidian:
if block 2 meters below {_n} is obsidian:
set {_n2} to block 2 meters below {_n}
if block 1 meter north of {_n2} is obsidian:
if block 1 meter south of {_n2} is obsidian:
if block 2 meters north of {_n} is obsidian:
set {_n2} to block 2 meters north of {_n}
if block 1 meter above {_n2} is obsidian:
if block 1 meter below {_n2} is obsidian:
# Insert some codes here.
add 1 to {_portals}
if block 2 meters above {_s} is obsidian:
set {_s2} to block 2 meters above {_s}
if block 1 meter north of {_s2} is obsidian:
if block 1 meter south of {_s2} is obsidian:
if block 2 meters below {_s} is obsidian:
set {_s2} to block 2 meters below {_s}
if block 1 meter north of {_s2} is obsidian:
if block 1 meter south of {_s2} is obsidian:
if block 2 meters south of {_s} is obsidian:
set {_s2} to block 2 meters south of {_n}
if block 1 meter above {_s2} is obsidian:
if block 1 meter below {_s2} is obsidian:
# Insert some codes here.
add 1 to {_portals}
if block 2 meters above {_e} is obsidian:
set {_e2} to block 2 meters above {_e}
if block 1 meter east of {_e2} is obsidian:
if block 1 meter west of {_e2} is obsidian:
if block 2 meters below {_e} is obsidian:
set {_e2} to block 2 meters below {_e}
if block 1 meter east of {_e2} is obsidian:
if block 1 meter west of {_e2} is obsidian:
if block 2 meters east of {_e} is obsidian:
set {_e2} to block 2 meters east of {_e}
if block 1 meter above {_e2} is obsidian:
if block 1 meter below {_e2} is obsidian:
# Insert some codes here.
add 1 to {_portals}
if block 2 meters above {_w} is obsidian:
set {_w2} to block 2 meters above {_w}
if block 1 meter east of {_w2} is obsidian:
if block 1 meter west of {_w2} is obsidian:
if block 2 meters below {_w} is obsidian:
set {_w2} to block 2 meters below {_e}
if block 1 meter east of {_w2} is obsidian:
if block 1 meter west of {_w2} is obsidian:
if block 2 meters west of {_w} is obsidian:
set {_w2} to block 2 meters west of {_w}
if block 1 meter above {_w2} is obsidian:
if block 1 meter below {_w2} is obsidian:
# Insert some codes here.
add 1 to {_portals}
# Here the clicked block is located on the bottom portion of the portal side.
if block 1 meter above event-block is obsidian:
if block 2 meters above event-block is obsidian:
set {_block} to block 1 meter above event-block
set {_n} to blocks 2 meters north of {_block}
set {_s} to blocks 2 meters south of {_block}
set {_w} to blocks 2 meters west of {_block}
set {_e} to blocks 2 meters east of {_block}
if block 2 meters above {_n} is obsidian:
set {_n2} to block 2 meters above {_n}
if block 1 meter north of {_n2} is obsidian:
if block 1 meter south of {_n2} is obsidian:
if block 2 meters below {_n} is obsidian:
set {_n2} to block 2 meters below {_n}
if block 1 meter north of {_n2} is obsidian:
if block 1 meter south of {_n2} is obsidian:
if block 2 meters north of {_n} is obsidian:
set {_n2} to block 2 meters north of {_n}
if block 1 meter above {_n2} is obsidian:
if block 1 meter below {_n2} is obsidian:
# Insert some codes here.
add 1 to {_portals}
if block 2 meters above {_s} is obsidian:
set {_s2} to block 2 meters above {_s}
if block 1 meter north of {_s2} is obsidian:
if block 1 meter south of {_s2} is obsidian:
if block 2 meters below {_s} is obsidian:
set {_s2} to block 2 meters below {_s}
if block 1 meter north of {_s2} is obsidian:
if block 1 meter south of {_s2} is obsidian:
if block 2 meters south of {_s} is obsidian:
set {_s2} to block 2 meters south of {_n}
if block 1 meter above {_s2} is obsidian:
if block 1 meter below {_s2} is obsidian:
# Insert some codes here.
add 1 to {_portals}
if block 2 meters above {_e} is obsidian:
set {_e2} to block 2 meters above {_e}
if block 1 meter east of {_e2} is obsidian:
if block 1 meter west of {_e2} is obsidian:
if block 2 meters below {_e} is obsidian:
set {_e2} to block 2 meters below {_e}
if block 1 meter east of {_e2} is obsidian:
if block 1 meter west of {_e2} is obsidian:
if block 2 meters east of {_e} is obsidian:
set {_e2} to block 2 meters east of {_e}
if block 1 meter above {_e2} is obsidian:
if block 1 meter below {_e2} is obsidian:
# Insert some codes here.
add 1 to {_portals}
if block 2 meters above {_w} is obsidian:
set {_w2} to block 2 meters above {_w}
if block 1 meter east of {_w2} is obsidian:
if block 1 meter west of {_w2} is obsidian:
if block 2 meters below {_w} is obsidian:
set {_w2} to block 2 meters below {_e}
if block 1 meter east of {_w2} is obsidian:
if block 1 meter west of {_w2} is obsidian:
if block 2 meters west of {_w} is obsidian:
set {_w2} to block 2 meters west of {_w}
if block 1 meter above {_w2} is obsidian:
if block 1 meter below {_w2} is obsidian:
# Insert some codes here.
add 1 to {_portals}
# TOP/BOTTOM CHECKING
# In this case, the clicked block is located at the bottom/top portion side of
# the assumed portal. The process here is almost the same except for the orientations.
# I don't think that I'll explain it again here because the code itself is self-
# explanatory.
if block 1 meter north of event-block is obsidian:
if block 1 meter south of event-block is obsidian:
set {_center} to blocks 2 meters below event-block
set {_s} to blocks 4 meters below event-block
set {_1} to blocks 2 meters south of {_center}
set {_2} to blocks 2 meters north of {_center}
if block 1 meter north of {_s} is obsidian:
if block 1 meter south of {_s} is obsidian:
if block 1 meter above {_1} is obsidian:
if block 1 meter above {_1} is obsidian:
if block 1 meter above {_2} is obsidian:
if block 1 meter above {_2} is obsidian:
# Insert some codes here.
add 1 to {_portals}
if block 1 meter east of event-block is obsidian:
if block 1 meter west of event-block is obsidian:
set {_center} to blocks 2 meters below event-block
set {_s} to blocks 4 meters below event-block
set {_1} to blocks 2 meters west of {_center}
set {_2} to blocks 2 meters east of {_center}
if block 1 meter east of {_s} is obsidian:
if block 1 meter west of {_s} is obsidian:
if block 1 meter above {_1} is obsidian:
if block 1 meter above {_1} is obsidian:
if block 1 meter above {_2} is obsidian:
if block 1 meter above {_2} is obsidian:
# Insert some codes here.
add 1 to {_portals}
if block 1 meter north of event-block is obsidian:
if block 2 meters north of event-block is obsidian:
set {_block} to block 1 meter north of event-block
set {_center} to blocks 2 meters below {_block}
set {_s} to blocks 4 meters below event-block
set {_1} to blocks 2 meters west of {_center}
set {_2} to blocks 2 meters east of {_center}
if block 1 meter east of {_s} is obsidian:
if block 1 meter west of {_s} is obsidian:
if block 1 meter above {_1} is obsidian:
if block 1 meter above {_1} is obsidian:
if block 1 meter above {_2} is obsidian:
if block 1 meter above {_2} is obsidian:
# Insert some codes here.
add 1 to {_portals}
if block 1 meter south of event-block is obsidian:
if block 2 meters south of event-block is obsidian:
set {_block} to block 1 meter south of event-block
set {_center} to blocks 2 meters below {_block}
set {_s} to blocks 4 meters below event-block
set {_1} to blocks 2 meters west of {_center}
set {_2} to blocks 2 meters east of {_center}
if block 1 meter east of {_s} is obsidian:
if block 1 meter west of {_s} is obsidian:
if block 1 meter above {_1} is obsidian:
if block 1 meter above {_1} is obsidian:
if block 1 meter above {_2} is obsidian:
if block 1 meter above {_2} is obsidian:
# Insert some codes here.
add 1 to {_portals}
if block 1 meter west of event-block is obsidian:
if block 2 meters west of event-block is obsidian:
set {_block} to block 1 meter west of event-block
set {_center} to blocks 2 meters below {_block}
set {_s} to blocks 4 meters below event-block
set {_1} to blocks 2 meters west of {_center}
set {_2} to blocks 2 meters east of {_center}
if block 1 meter east of {_s} is obsidian:
if block 1 meter west of {_s} is obsidian:
if block 1 meter above {_1} is obsidian:
if block 1 meter above {_1} is obsidian:
if block 1 meter above {_2} is obsidian:
if block 1 meter above {_2} is obsidian:
# Insert some codes here.
add 1 to {_portals}
if block 1 meter east of event-block is obsidian:
if block 2 meters east of event-block is obsidian:
set {_block} to block 1 meter east of event-block
set {_center} to blocks 2 meters below {_block}
set {_s} to blocks 4 meters below event-block
set {_1} to blocks 2 meters west of {_center}
set {_2} to blocks 2 meters east of {_center}
if block 1 meter east of {_s} is obsidian:
if block 1 meter west of {_s} is obsidian:
if block 1 meter above {_1} is obsidian:
if block 1 meter above {_1} is obsidian:
if block 1 meter above {_2} is obsidian:
if block 1 meter above {_2} is obsidian:
# Insert some codes here.
add 1 to {_portals}
#
if block 1 meter north of event-block is obsidian:
if block 1 meter south of event-block is obsidian:
set {_center} to blocks 2 meters above event-block
set {_n} to blocks 4 meters above event-block
set {_1} to blocks 2 meters south of {_center}
set {_2} to blocks 2 meters north of {_center}
if block 1 meter north of {_n} is obsidian:
if block 1 meter south of {_n} is obsidian:
if block 1 meter above {_1} is obsidian:
if block 1 meter above {_1} is obsidian:
if block 1 meter above {_2} is obsidian:
if block 1 meter above {_2} is obsidian:
# Insert some codes here.
add 1 to {_portals}
if block 1 meter east of event-block is obsidian:
if block 1 meter west of event-block is obsidian:
set {_center} to blocks 2 meters above event-block
set {_n} to blocks 4 meters above event-block
set {_1} to blocks 2 meters west of {_center}
set {_2} to blocks 2 meters east of {_center}
if block 1 meter east of {_n} is obsidian:
if block 1 meter west of {_n} is obsidian:
if block 1 meter above {_1} is obsidian:
if block 1 meter above {_1} is obsidian:
if block 1 meter above {_2} is obsidian:
if block 1 meter above {_2} is obsidian:
# Insert some codes here.
add 1 to {_portals}
if block 1 meter north of event-block is obsidian:
if block 2 meters north of event-block is obsidian:
set {_block} to block 1 meter north of event-block
set {_center} to blocks 2 meters above {_block}
set {_n} to blocks 4 meters above event-block
set {_1} to blocks 2 meters west of {_center}
set {_2} to blocks 2 meters east of {_center}
if block 1 meter east of {_n} is obsidian:
if block 1 meter west of {_n} is obsidian:
if block 1 meter above {_1} is obsidian:
if block 1 meter above {_1} is obsidian:
if block 1 meter above {_2} is obsidian:
if block 1 meter above {_2} is obsidian:
# Insert some codes here.
add 1 to {_portals}
if block 1 meter south of event-block is obsidian:
if block 2 meters south of event-block is obsidian:
set {_block} to block 1 meter south of event-block
set {_center} to blocks 2 meters above {_block}
set {_n} to blocks 4 meters above event-block
set {_1} to blocks 2 meters west of {_center}
set {_2} to blocks 2 meters east of {_center}
if block 1 meter east of {_n} is obsidian:
if block 1 meter west of {_n} is obsidian:
if block 1 meter above {_1} is obsidian:
if block 1 meter above {_1} is obsidian:
if block 1 meter above {_2} is obsidian:
if block 1 meter above {_2} is obsidian:
# Insert some codes here.
add 1 to {_portals}
if block 1 meter west of event-block is obsidian:
if block 2 meters west of event-block is obsidian:
set {_block} to block 1 meter west of event-block
set {_center} to blocks 2 meters above {_block}
set {_n} to blocks 4 meters above event-block
set {_1} to blocks 2 meters west of {_center}
set {_2} to blocks 2 meters east of {_center}
if block 1 meter east of {_n} is obsidian:
if block 1 meter west of {_n} is obsidian:
if block 1 meter above {_1} is obsidian:
if block 1 meter above {_1} is obsidian:
if block 1 meter above {_2} is obsidian:
if block 1 meter above {_2} is obsidian:
# Insert some codes here.
add 1 to {_portals}
if block 1 meter east of event-block is obsidian:
if block 2 meters east of event-block is obsidian:
set {_block} to block 1 meter east of event-block
set {_center} to blocks 2 meters above {_block}
set {_n} to blocks 4 meters above event-block
set {_1} to blocks 2 meters west of {_center}
set {_2} to blocks 2 meters east of {_center}
if block 1 meter east of {_n} is obsidian:
if block 1 meter west of {_n} is obsidian:
if block 1 meter above {_1} is obsidian:
if block 1 meter above {_1} is obsidian:
if block 1 meter above {_2} is obsidian:
if block 1 meter above {_2} is obsidian:
# Insert some codes here.
add 1 to {_portals}
send "There are %{_portals}% detected. :)"
```