*Current* target 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 community!

    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.

Hyao

Active Member
Apr 1, 2017
73
4
8
Hello, I'm using Bensku's fork (mc1.12) and have downloaded each of used addons today, so should be up to date on all.

I'm trying to make the player see a blue block when there's an air block, a red when not, but all in all it should appear above the player's target block. Here's what I have.

Code:
 on hotbar switch:
    wait a tick
    if player's tool is paper:
        while player's tool is paper:
            set {_target} to player's target block
            set {_oldBlock} to block above {_target}
            set {_viewBlock} to location of {_oldBlock}
            if block at {_viewBlock} is air:
                make player see block at {_viewBlock} as 35:11
            else:
                make player see block at {_viewBlock} as 35:14
            wait a tick
            make player see block at {_viewBlock} as {_oldBlock}

Now, this works, it shows the blue wool when there's air and red when not - it also flickers which means it does respect what was there before, but my issue is that the target block doesn't update. I can switch to a paper, look around, yet the block which the whole execution happens on doesn't change position. It only stays where I had first pulled up the paper. Anyone know a workaround or a fix? Really struggling on this one.
 
Status
Not open for further replies.