Template for processing space with the matrix x1*y1*z1 - x2*y2*z2

Started by EXIBIT on

Topic category: Help with modding (Java Edition)

Last seen on 09:11, 27. Feb 2022
Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Template for processing space with the matrix x1*y1*z1 - x2*y2*z2

Hello everyone. I was making a mod in which I needed to process custom blocks in the pos1 pos2 space. (I had to take NBT(num) from them). Previously, in the block that was supposed to receive the sum of NBT (num) of all blocks, I entered p1 and p2. Calculates correctly, but does not work in any way. Honestly, I tried to make three cycles nested in each other myself, but firstly, it was too cumbersome, and secondly, nothing worked out that way. Does anyone have a template for such a task? Or at least hint how it can all be made easier. please ;(

P.S. if I made a mistake in the forum, then I apologize, maybe someone has this working template, then I will be grateful. I will be grateful for any help.

P.S.S. I don't understand English well, but I will listen to anyone who can help

Last seen on 20:38, 16. Sep 2023
Joined Dec 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
    Hi, tell me, could you…
Mon, 02/07/2022 - 15:05

 

 

Hi, tell me, could you describe the task in detail, what should it be?

Multiblock structure? What should she do and depending on what?

As they say, the devil is in the details, I roughly understand what you mean, but for less water, write everything in detail

Last seen on 09:11, 27. Feb 2022
Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Well. The task is as follows…
Wed, 02/09/2022 - 05:48

Well. The task is as follows. There is a block (controller) that must collect NBT tags (numbers) of blocks. In this block (controller), the player must enter the coordinates of the first block (with the NBT tag) and the coordinates of the second block (with the NBT tag). In any case, a matrix is obtained. Let's say the player entered the coordinates (first block) x1=0 y1=0 z1=0 and (second block) x2=10 y2=10 z2=10. And so the block (controller) must define each block in the space from 0 0 0 to 10 10 10 and if it is the right block by condition, it (controller) takes the NBT tags of these blocks and adds them to itself in NBT and adds them.

I hope you have clearly described my task. I have to write through a translator, because I don't speak pure English (Sorry

Last seen on 20:38, 16. Sep 2023
Joined Dec 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I also write through a…
Thu, 02/17/2022 - 08:20

I also write through a translator

I now tried to implement all this for an example, but it turned out to be too complicated and cumbersome for me.
but i have ideas

All blocks must have the checkbox slab entity checked
Further, if the matrix perimeter is determined by blocks, then in these blocks you need to place a procedure that will write the coordinates of these blocks to global variables by trigger when the block is set.
The coordinates are transferred to the controller through global variables, it is not necessary through the NBT.

Next is the matter of selections
if the matrix is ​​0 0 0 x 10 10 10

we perform a cyclic check of each block for the presence of NBT

While(z<11){

             While(x<11){

                           x=x+1

                           While(y<11){

                                                    [Get NBTteg from block at X Y Z]

                                                     y=y+1

                            }

               y=0

             }

        x=0

}

[Set NBTteg from block <<Controller>>]

 

The main thing is to correctly set the cycle
And write the NBT from blocks into variables, and after the completion of the calculations, write the result to write the NBT of the Controller

Last seen on 20:38, 16. Sep 2023
Joined Dec 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Sorry I made a mistake  …
Thu, 02/17/2022 - 08:24

Sorry I made a mistake

 

While(z<11){

             z=z+1

             While(x<11){

                           x=x+1

                           While(y<11){

                                                    [Get NBTteg from block at X Y Z]

                                                     y=y+1

                            }

               y=0

             }

        x=0

}

[Set NBTteg from block <<Controller>>]

Last seen on 09:11, 27. Feb 2022
Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
OMG Thank you so much. I…
Thu, 02/17/2022 - 10:15

OMG Thank you so much. I will definitely try your way. ) Good luck with everything.