• Hey! Register here to create your account, engage with the community, and talk about what is new!

How to detect proximity to a block type ?

Frizou

New member
Joined
Aug 16, 2022
Messages
12
Reaction score
2
as an example : detect if the player is 1 block away or less than any oak log in the game
 

Anthonie04

New member
Joined
Sep 26, 2022
Messages
4
Reaction score
0
You could get all locations that are 1 block away from the player using the set var -> locations -> and then shift loc, after aligning it first and then get a corresponding variable with world actions to set the block material and set a var with that loc var you’ve just made, and then check if that block equals oak log with if var. or you could get locs of all oak logs in game, and then just if player is in range {those locs} {1}.
 

Anthonie04

New member
Joined
Sep 26, 2022
Messages
4
Reaction score
0
but it wont work if you want the player to be farther/closer
You can just keep stacking adjacent repeats with the loc that keeps track of loc of previous adjacent repeat
 

blazebeckett

Active member
Joined
Mar 6, 2021
Messages
58
Reaction score
2
This method is a bit more laggy i feel like but you could get 2 corners of the players location however many blocks apart and then use Repeat: On Grid
 
Top Bottom