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

how to set blocks around a point

RedstoneProJosh

New member
Joined
Apr 2, 2024
Messages
1
Reaction score
0
hey so i'm making a game called sculkwar and i'm not quite sure how to set the blocks around where the player is looking to sculk (including the block they are looking at) in a 3x3 area.

thanks in advance
 

CoderElias

Well-known member
Overlord
Joined
Jun 15, 2022
Messages
78
Reaction score
10
You can do this by using variables, firstly place down a variable block and select 'shift all axis'. In the chest the a variable, I would name that 'pos1', and then a game value: 'target block loc', Then also put three numbers in the chest, the first being 1, second 0 and third also 1. Now place another variable and select 'shift all axis' again. In the chest put a variable, I would name it 'pos2' and then a game value 'target block location'. Then put three numbers in the chest again, the first being -1, second 0 and third also being -1. Now you can use the 'set region' game event with the two position variable to set an area to a certain block in a 3x3 grid.

If you have any questions, reply to this post or dm me.
 
Top Bottom