#Rtp

1 messages · Page 1 of 1 (latest)

scenic topaz
#
 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
fickle hornet
#

just add a check to make sure the block is black concrete powder, no?

scenic topaz
#

Yes i did put a check in isSafeBlock but by doing this i can't find a location

fickle hornet
#

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?

scenic topaz
#

if {_b} is black concrete powder

fickle hornet
#

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

scenic topaz
#
  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

fickle hornet
#

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

scenic topaz
#

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```
scenic topaz
#
 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

fickle hornet