[RESOLVED] Help with Multi-Block Distruction

Started by BaconWizard17 on

Topic category: Help with MCreator software

Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
[RESOLVED] Help with Multi-Block Distruction
Thu, 07/09/2020 - 03:15 (edited)

Hi all! I need some help. I'm working on a mod that creates 3-block wide double doors. So basically, it's like 2 1.5 block doors next to each other. When closed, the doors are made up of 6 components, corresponding to the 6 blocks that the door occupies. Placing the bottom middle block causes the entire door to spawn, and then I want to make it so that breaking any one door block will break the remaining 5.

I've been working on the breaking procedure, but I'm having some trouble with it. It only seems to work if the door was placed in a certain direction (currently, I'm just testing the procedure out on the bottom middle block, but once I can get that to work, I'll create similar procedures for the other 5 blocks). 

Here's a picture of the code of the procedure (split into two columns so it's easier to see, but it's all connected)

Screenshot of procedure code, showing if statements that pertain to removing the blocks when the door is placed in different directions

I want to get it so that it only removes the door blocks in any orientation the door happens to be in. However, I don't think it's processing the direction of the door, because it always acts as though the door is facing North. So if I place the door facing East or West, it only deletes the middle two blocks (and if I place any blocks in front of or behind the door in the middle, it will delete those as well). It works if the door is facing south as well, because it's the same relative placements of the block. I would've simplified it, but I couldn't figure out how to do something like a North OR South case and an East OR West case. 

Screenshot of procedure code, showing if statements that pertain to placing the door in different orientations

This is a screenshot of the block placement procedure, which works correctly. I can place the door facing any direction, but I can only destroy it fully when it's facing North or South.

 

Any help with this matter would be greatly appreciated, as I would like this to handle as a single element that doesn't require multiple steps to break. 

Currently, I want to figure out the placing and breaking of the door, and then I'll focus on actually making it open. I'm pretty sure I have an idea of how to do that. If possible, I would like to stick to using the graphical interface, as I'm not very familiar with java, but if that can't be avoided, I understand. Any help would be greatly appreciated! Thank you so much! 

Edited by BaconWizard17 on Thu, 07/09/2020 - 03:15
Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I figured out my issue! The…
Thu, 07/09/2020 - 03:16

I figured out my issue! The problem was that since the block I was checking the direction of had already been broken, it was just checking the direction of the air, so it automatically assumed north. I changed it so now it checks the direction of the door block above it

Joined Apr 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Can you show me how I can do…
Sun, 04/11/2021 - 18:37

Can you show me how I can do the fix I am trying to make something like this.