Solved If block at {_x} {_y} {_z} is {_block}

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

Computerize

Member
Oct 10, 2019
38
0
0
23
Code:
  loop all players:
    set {_x} to x-coord of loop-player
    set {_y} to y-coord of loop-player
    set {_z} to z-coord of loop-player
    set {_totalUp} to 0
    if block at {_x} {_y} {_z} is "jungle wood bark block":
      loop 25 times:
        if block at {_x} {_y} {_z} is jungle wood bark block:
          add 1 to {_y}
          add 1 to {_totalUp}
        else:
          add 1 to {_y}
          add 1 to {_totalUp}
          if block at {_x} {_y} {_z} isn't jungle wood bark block:
            execute console command "/pex user %loop-player% add minecraft.command.tp"
            make loop-player execute command "/tp ~ ~%{_totalUp}% ~"
            execute console command "/pex user %loop-player% remove minecraft.command.tp"
The code above gives me the following error:
"Can't compare 'block at {_x} {_y} {_z}' with a text" - (Line 6)
Is there any alternative to do something like this?
 
Code:
  loop all players:
    set {_x} to x-coord of loop-player
    set {_y} to y-coord of loop-player
    set {_z} to z-coord of loop-player
    set {_totalUp} to 0
    if block at {_x} {_y} {_z} is "jungle wood bark block":
      loop 25 times:
        if block at {_x} {_y} {_z} is jungle wood bark block:
          add 1 to {_y}
          add 1 to {_totalUp}
        else:
          add 1 to {_y}
          add 1 to {_totalUp}
          if block at {_x} {_y} {_z} isn't jungle wood bark block:
            execute console command "/pex user %loop-player% add minecraft.command.tp"
            make loop-player execute command "/tp ~ ~%{_totalUp}% ~"
            execute console command "/pex user %loop-player% remove minecraft.command.tp"
The code above gives me the following error:
"Can't compare 'block at {_x} {_y} {_z}' with a text" - (Line 6)
Is there any alternative to do something like this?
you forgot to seperate the coordinates with a commma.
Code:
block at {_x}, {_y} and {_z}
 
Status
Not open for further replies.