I cant get blocks to place in a 3x3 area right [Solved]

Started by ImNotFun on

Topic category: Help with MCreator software

Last seen on 07:27, 21. Jun 2022
Joined Sep 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I cant get blocks to place in a 3x3 area right [Solved]
Wed, 08/12/2020 - 01:04 (edited)

Like the title says, I can't get blocks to place on a 3x3 grid in the correct axis.

To explain, anyone played Rainbow Six Siege? I'm trying to make a mod that sort of emulates that experience. I'm trying to make blocks place in a 3x3 grid to 'reinforce' walls, and so far it works but only on the Z axis.

Code

Code

To explain, this procedure runs after a parent block is right clicked. It basically checks to see if there are any blocks on the positive and negative X axis and then places blocks on the Z axis and vise versa. Like I said, this works when the procedure places blocks on the Z axis but not on the X axis. I have no idea why this is as I basically just copy-pasted the code that checks if there are blocks on a certain axis. I know some parts are messed up like the Z and X coordinates being flipped around in the checks but It worked on the Z axis so I was too scared to touch it.

How it's meant to work

Block

When a 'Reinforcement' block is placed against a wall, [when right clicked] it should create a 3x3 barrier.

block2

This is what happens when the blocks are facing the Z axis (as in the big flat sides face the X axis and the edges face the Z axis). This is what I want to happen, and so this is in my eyes a successful test.

Block3

This is what happens when the blocks are facing the opposite axis. I implemented some checks to try and get rid of that weird outcrop in the middle, which worked on the Z axis but not here. I tried another fix which ran a check before any code was run and it just resulted in a 3 block column straight up on the X axis.

The problem

I have literally no idea why this is happening. I'm not the best at procedures or code in general, and have been thinking of a good way to implement this for a good while. If anyone has any clue as to why this happens any help would be greatly appreciated, and if needed I can send more screenshots of procedures or ingame tests.

Thanks :D

Edited by ImNotFun on Wed, 08/12/2020 - 01:04
Last seen on 07:27, 21. Jun 2022
Joined Sep 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
In case anyone else has this…
Wed, 08/12/2020 - 01:03

In case anyone else has this problem, I'll leave this on this forum post.

I figured it out. I think it was just a bug with MCreator which I got around by replacing the two independant 'if' statements with an 'if else' one.

ifelse

Last seen on 21:05, 13. Apr 2024
Joined Dec 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
do you still have this…
Mon, 03/01/2021 - 18:03

do you still have this procedure? I’m trying to do something like this but I can’t, if I don’t have the images with a better quality, I can’t see the procedures