Jump to content

Recommended Posts

Posted

I want to be able to press buttons inside the server disconnected GUI and the Server select GUI from a client-side mod. I am playing on an SMP with a few other people, and we build lots of farms in which a lot of people afk. AFK-ing is fully allowed on the server, but my internet cuts out quite frequently, so I wanted to make a forge mod that would automatically reconnect (I know there is an autoreconnect mod for fabric, but we use forge mods on the client-side for a lot of things). I have tried

mc.currentScreen.mouseClicked(x, y, 0);
MinecraftForge.EVENT_BUS.post(new GuiScreenEvent.MouseClickedEvent.Pre(mc.currentScreen, x, y, 0));

, but I need a way to find the "back to server menu" button's location, as it changes depending on GUI scale. I also tried doing mouseClicked(x,y,0) for every 10th pixel, but that still didn't work, so maybe this just doesn't work. please help. 

  • Guest locked this topic
Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.