I'm trying to get a block in a direction but it says "variables cannot be used here" at the line "set {_block} to location at block {_amount} {_facing} of {_center}"
If I put east instead of {_facing} (which is a direction I checked) it works
Does anyone have any idea what's wrong?
If I put east instead of {_facing} (which is a direction I checked) it works
Does anyone have any idea what's wrong?
Code:
function getDirection(direction: text) :: direction:
if {_direction} is "north":
return north
else if {_direction} is "east":
return east
else if {_direction} is "south":
return south
else if {_direction} is "west":
return west
function getBlockList(list: objects, center: location) :: locations:
loop {_list::*}:
set {_info::*} to split loop-value at ";"
set {_amount} to {_info::1} parsed as number
if {_info::2} is "center":
add {_center} to {_locations::*}
else:
set {_facing} to getDirection({_info::2})
set {_block} to location at block {_amount} {_facing} of {_center}
broadcast "&eBlock: &f%{_block}%"
add {_block} to {_locations::*}
return {_locations::*}