#Checking for block breaking at a certain location

1 messages · Page 1 of 1 (latest)

lofty sinew
#

I used to set the stove cordinates using this code ```set {savefurnace} to location of block below player`` but now I used random picking as to teleport the player to random blocks but only for the block and set to a variable but now when I check, the block breaks and I found a difference between the cordinates after random picking and the block breaking cordinates, namely the difference in yaw and pitch, how can I fix my problem? if you need the code I can provide it

#

And yes, I need the block coordinates for more than just that, so nbt is not appropriate

deft hill
#

What

#

“if you need the code i can provide it”
Shouldve done so from the start

#

Also, you haven’t explained your issue or goal clearly; i have no idea what you want

lofty sinew
#

What I want... I want the heater to not break down at certain positions.

#

I'll text you the code.

#
    set {_rtp} to true
    while {_rtp} is true:
        set {xx} to random integer between -1000 and 1000
        set {zz} to random integer between -1000 and 1000
        set {_y} to 200
        set {_location} to location at (({xx} + 0.500), {_y}, ({zz} + 0.500)) in world "world"
        while block at {_location} is air:
            remove 1 from {_y}
            set {_location} to location at ({xx} + 0.500), {_y}, ({zz} + 0.500)) in world "world"
            wait 1 tick
        if block at {_location} is not {@blockblacklist}:
            if region at {_location} is not set:
                add 1 to {_y}
                set {_location} to location at (({xx} + 0.500), ({_y} + 0.500), ({zz} + 0.500)) in world "world"
                set {_rtp} to false
                set block at {_location} to furnace
                set {savefurnace} to location of {_location}
            wait 1 tick``` and ```on break of ender chest or furnace:
    send "%event-block's location%" to player
    send "%{savefurnace}%" to player
    if event-block's location is {savefurnace}:
        cancel event
        send "////"```
lofty sinew
deft hill
#

So you want certain blocks to be unable to be broken in certain areas?

#

Also that rtp script sucks

#

Use highest solid block

#

And x and z should be local vars

lofty sinew
deft hill
#

For what

#

Why?

lofty sinew
deft hill
#

Why

#

Just use event location

lofty sinew
# deft hill Why?

I'm displaying the information in the chat room where the stove is located. -_-

deft hill
#

Yes

lofty sinew
deft hill
#

But were talking about things that are COMPLETELY DIFFERENT SCRIPS

#

Im talking about the rtp attempt you made rn, not the furnace protector

lofty sinew
#

But how do you fix it?

#

Is the error in the rtp?

deft hill
#

Why not just the block’s location so you dont need .5?

lofty sinew
deft hill
#
  add event-block’s location to {protectedBlocks::*}

on mine:
  if {protectedBlocks::*} contains event-block’s location:
    cancel event
    send “you cant break that block!” to player```