if {_b} is not grass block:
return true
return false
# Get the highest safe block at a location
function getHighestBlock(l: location) :: location:
if world environment of world of {_l} = normal:
set {_b} to highest block at {_l}
loop blocks above {_b}:
if all:
isSafeBlock(block above loop-block) = true
isSafeBlock(block 2 above loop-block) = true
then:
return location 0.5 above loop-block```
i would like to spawn only on top of black concrete powder idk where to put this condition
#Rtp
1 messages · Page 1 of 1 (latest)
just add a check to make sure the block is black concrete powder, no?
Yes i did put a check in isSafeBlock but by doing this i can't find a location
hmm?
do you mean you get a theres no location in a function event error, or that the function fails to find a suitable safe location?
if {_b} is black concrete powder
that looks good to me (aside from the missing : at the end of the line)
can I see how you added it to the code
if {_b} is not grass block:
if {_b} is black concrete powder:
return true
return false
# Get the highest safe block at a location
function getHighestBlock(l: location) :: location:
if world environment of world of {_l} = normal:
set {_b} to highest block at {_l}
loop blocks above {_b}:
if all:
isSafeBlock(block above loop-block) = true
isSafeBlock(block 2 above loop-block) = true
then:
return location 0.5 above loop-block```
ops
i mean inside the if all: at the bottom would work i think
with loop-block
cause if you put it in isSafeBlock(), you'd require the 2 blocks above the location to be black concrete powder as well
wait maybe because im not returning false 2 times?
if {_b} is not grass block:
if {_b} is black concrete powder:
return true
return false
return false```
put it here
if world environment of world of {_l} = normal:
set {_b} to highest block at {_l}
loop blocks above {_b}:
if all:
isSafeBlock(block above loop-block) = true
isSafeBlock(block 2 above loop-block) = true
loop-block contains black concrete powder
then:
return location 0.5 above loop-block```
?
what if i want to check the highest block and its black concrete powder
is that not what I suggested?