GUI does not close when Block is Destroyed... (?)

Started by YkZen on

Topic category: Help with Minecraft modding (Java Edition)

Joined Apr 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
GUI does not close when Block is Destroyed... (?)
Tue, 04/12/2022 - 09:19 (edited)

I don't think it's a bug, maybe now it's something that has to be programmed in the Trigger -> Procedure...

I have been doing several tests and I have noticed that in recent versions of MCreator the GUI no longer closes when destroying or exploiting the block with GUI... (Even updating the old mod creates this problem)

My question is how can I do now in recent versions so that the GUI closes when destroying or exploiting or changing the block? (before I didn't have to do anything and it happened by itself)

Example:

Ver. MCreator 2020.2 The GUI closed itself when the block was destroyed. (FORGE 1.14)

close gui

 

Ver. MCreator 2021.1 The GUI stays open even though the block was destroyed. (FORGE 1.16)

no close gui

 

Files and Others:

https://mcreator.net/modification/59385/smelting-machine-procedure-tuto…

Edited by YkZen on Tue, 04/12/2022 - 09:19
Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
save the coordinates of the…
Tue, 04/12/2022 - 10:09

save the coordinates of the block as a player variable when opened, and reset them when closed. In your "on tick while gui is open" check if your block still exists there. if not, close the gui.

Its not perfect but it should do in most cases

Joined Apr 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thank you very much! For…
Wed, 04/13/2022 - 01:34

Thank you very much! For your answer.

But I apologize, I don't fully understand, I've been checking and researching but I can't find "on tick while gui is open" or I don't understand what it means.

If you could be more specific or give me an example, in any case, I will continue investigating what he told me, thanks again.

Joined Apr 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
They're referring to an…
Fri, 04/22/2022 - 02:03

They're referring to an option in the gui element. There should be an expandable element in the bottom stating "GUI procedure triggers". Click there and the option for "While this GUI is open tick" will appear