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
#Checking for block breaking at a certain location
1 messages · Page 1 of 1 (latest)
And yes, I need the block coordinates for more than just that, so nbt is not appropriate
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
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 "////"```
Now I hope I've provided everything I need
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
about the x z's, I use them outside of code.
I don't want the block to be broken which is on these cordinates which are in {savefurnace}
I'm displaying the information in the chat room where the stove is located. -_-
Yes
I don't quite get it
But were talking about things that are COMPLETELY DIFFERENT SCRIPS
Im talking about the rtp attempt you made rn, not the furnace protector
I'm having a little trouble communicating in the translator but rtp is fine, I'm having trouble setting the coordinates in {savefurnace} most likely
But how do you fix it?
Is the error in the rtp?
Thats its own issue
Why not just the block’s location so you dont need .5?
If I understand correctly what you wrote, how do you do it?
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```