update/notify block at XYZ procedure block help

Started by philtastic on

Topic category: Help with modding (Java Edition)

Last seen on 17:00, 26. Oct 2021
Joined Oct 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
update/notify block at XYZ procedure block help

 

 This is the code that I have for a Procedure :


 |[   if   [ [ Get block at x: [Get Local: selectedX] y: [ [Get Local: selectedY] - [1] ] z: [Get Local: selectedZ] ] = [minecraft:water] ]

      do        \/

                 [ Remove block at x: [Get Local: selectedX] y: [ [Get Local: selectedY] - [1] ] z: [Get Local: selectedZ] ]

                 [ Update/notify block at x: [ [Get Local: selectedX] + [1] ] y: [ [Get Local: selectedY] - [1] ] z: [ [Get Local: selectedZ] - [1] ]

                 [ Update/notify block at x: [ [Get Local: selectedX] - [1] ] y: [ [Get Local: selectedY] - [1] ] z: [ [Get Local: selectedZ] - [1] ]

                 [ Update/notify block at x: [ [Get Local: selectedX] + [1] ] y: [ [Get Local: selectedY] - [1] ] z: [ [Get Local: selectedZ] + [1] ]

                 [ Update/notify block at x: [ [Get Local: selectedX] - [1] ] y: [ [Get Local: selectedY] - [1] ] z: [ [Get Local: selectedZ] + [1] ]

          ]|

                                                                                                                                     forge workspace for : 1.16.5 (Java: Minecraft)


 As shown in the segment above, the Flow Control block will check if the block below is water, removes said water and updates the adjacent blocks.

 

 As a context, I am attempting to remove a fluid block by block in a body of water to simulate evaporation. I skipped to the only part where the action happens to keep simplicity.

 

 During the test, as expected, blocks of water are being removed. Though shortly after the first few cycles of this code (every 60th playerTickUpdate (3sec)) however you will quickly find that the removed water blocks aren't being filled in by the surrounding fluid body. I expected that updating the block at the given coordinates would let water flow. Further testing showed that some blocks of water do get updated, and fill in the removed block of water.

 

 My first guess is to simply schedule the update at a later state, so I have replaced the following code :


 |[-]|          [ Update/notify block at x: [ [Get Local: selectedX] + [1] ] y: [ [Get Local: selectedY] - [1] ] z: [ [Get Local: selectedZ] - [1] ]

 |[-]|          [ Update/notify block at x: [ [Get Local: selectedX] - [1] ] y: [ [Get Local: selectedY] - [1] ] z: [ [Get Local: selectedZ] - [1] ]

 |[-]|          [ Update/notify block at x: [ [Get Local: selectedX] + [1] ] y: [ [Get Local: selectedY] - [1] ] z: [ [Get Local: selectedZ] + [1] ]

 |[-]|          [ Update/notify block at x: [ [Get Local: selectedX] - [1] ] y: [ [Get Local: selectedY] - [1] ] z: [ [Get Local: selectedZ] + [1] ]

 

 |[+]|         [ Schedule tick update of block at x: [ [Get Local: selectedX] + [1] ] y: [ [Get Local: selectedY] - [1] ] z: [ [Get Local: selectedZ] - [1] ]

 |[+]|         [ Schedule tick update of block at x: [ [Get Local: selectedX] - [1] ] y: [ [Get Local: selectedY] - [1] ] z: [ [Get Local: selectedZ] - [1] ]

 |[+]|         [ Schedule tick update of block at x: [ [Get Local: selectedX] + [1] ] y: [ [Get Local: selectedY] - [1] ] z: [ [Get Local: selectedZ] + [1] ]

 |[+]|         [ Schedule tick update of block at x: [ [Get Local: selectedX] - [1] ] y: [ [Get Local: selectedY] - [1] ] z: [ [Get Local: selectedZ] + [1] ]


 Changes applied above have proven to have Unchanged Results.

 

 My Question is, does the tick update of a block also effect fluids? And if so, can there be alternative means of updating a block of water, the same way a gravity block updates?

 Please Explain the function and properties of the Schedule tick update block and the Update/notify block works.

 And lastly, may there be a another workaround for this? I have been thinking about checking if the adjacent blocks are water_still blocks and if so, if I can replace these blocks with   water.

 

 This is really the main question of this post.

 

     Thank you for reading,

 The one and only

       philtastic

 

 

 As a related topic on the matter, I cannot find documentation about checking minecraft water levels, any tips on that would be kindly appreciated

Last seen on 17:00, 26. Oct 2021
Joined Oct 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I have tested replacing…
Tue, 10/26/2021 - 16:41

I have tested replacing water_still blocks with water_flowing and bubble_column, these changes had no effects.

Screenshot of the code result from the original forum post

 

Last seen on 17:00, 26. Oct 2021
Joined Oct 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
[WORKAROUND]    This issue…
Tue, 10/26/2021 - 17:00

[WORKAROUND]

 

 This issue can be worked around by running a vanilla command:

|[-]|          [ Remove block at x: [Get Local: selectedX] y: [ [Get Local: selectedY] - [1] ] z: [Get Local: selectedZ] ]

 

|[+]|         [ Execute command / [ "setblock ~ ~ ~ minecraft:air" at x: [Get Local: selectedX] y: [ [Get Local: selectedY] - [1] ] z: [Get Local: selectedZ] ]

 Experiments showed that there was a positive result and adjacent water filled in removed blocks of water as expected.

 

 Now just the question, just how do update/notify tick updates, and will there be a block that can update fluids without having to resort to vanilla commands. (running such command in a world where commands are disabled is not possible)