Posted April 29, 20187 yr So, Im creating a MIDI block. When you right click it, it opens a GuiScreen (no container) and using a button, you can open midi devices connected to your computer and play music in-game. Only issue tho, when i leave the GUI, i want to close the MIDI Reciever. Unfortunately, I havent found a way to detect when it closes. I have some ideas but I don't feel like they are optimal. -Check if player clicks ESC before closing the Reciever. Unfortunately, you can leave a GUI without pressing ESC by dying or when the TileEntity gets destroyed. -Using player capabilities. It might be a little overkill for this case. -Constantly be checking if` Minecraft.getMinecraft().thePlayer.currentScreen == null` Its pretty resource intensive though. Anyone know how I could do it in an efficient way? Thank you in advance and thanks for taking the time to read until here.
April 29, 20187 yr Author I feel dumb for not thinking about it, I just found the method in the superclass, thank you so much!
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.