I am looking to condense this code, however I can't find any solutions that work.
The main issue I am having is that I would like to set the direction via variable however that doesn't work, so any one else have any other ideas.
code_language.skript:
on rightclick on cobblestone:
if block 2 north of event-block is air:
add north to {_directions::*}
if block 2 east of event-block is air:
add east to {_directions::*}
if block 2 south of event-block is air:
add south to {_directions::*}
if block 2 west of event-block is air:
add west to {_directions::*}
if size of {_directions::*} != 0:
set {_direction} to random integer from 1 to (size of {_directions::*})
if {_directions::%{_direction}%} is north:
set block 1 north of event-block to cobblestone
set block 2 north of event-block to cobblestone
if {_directions::%{_direction}%} is east:
set block 1 east of event-block to cobblestone
set block 2 east of event-block to cobblestone
if {_directions::%{_direction}%} is south:
set block 1 south of event-block to cobblestone
set block 2 south of event-block to cobblestone
if {_directions::%{_direction}%} is west:
set block 1 west of event-block to cobblestone
set block 2 west of event-block to cobblestone
The main issue I am having is that I would like to set the direction via variable however that doesn't work, so any one else have any other ideas.