Craftit7 Posted July 1, 2021 Posted July 1, 2021 So, I want to listen for client pressing H and then open a custom gui. The mod is a mod that will contain custom text that will be sent in the chat, sending in chat using command "say {msg}" works, the problem here is opening a gui on key press. Can anyone help? Btw, I still don't have a custom gui, i need help on how to do that too. Quote
Craftit7 Posted July 1, 2021 Author Posted July 1, 2021 Hello, I wasn't able to make what you said. Can you maybe link the docs? I really need them. Or just provide a working example of what you said. Quote
Craftit7 Posted July 1, 2021 Author Posted July 1, 2021 I wasn't able to find anything about "ClientTicks". Here is my mod main file:- package com.craftit7.fpsbooster; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.eventbus.api.IEventBus; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; @Mod("customchatembeds") public class FpsBooster { public static final Logger LOGGER = LogManager.getLogger(); public static final String MOD_ID = "customchatembeds"; public FpsBooster() { IEventBus Bus = FMLJavaModLoadingContext.get().getModEventBus(); MinecraftForge.EVENT_BUS.register(this); } private void setup(final FMLCommonSetupEvent event) {} } Quote
Craftit7 Posted July 1, 2021 Author Posted July 1, 2021 I said please link the docs, i cant find it. Quote
Craftit7 Posted July 1, 2021 Author Posted July 1, 2021 Urgh... So how am i supposed to know how to use KeyBinding? I searched the whole internet Quote
Craftit7 Posted July 1, 2021 Author Posted July 1, 2021 import net.minecraft.client.settings.KeyBinding; Am i correct? Also where shall i put the keybind thingy? at setup()? Quote
Craftit7 Posted July 1, 2021 Author Posted July 1, 2021 What Shall I put in the consturctor? KeyBinding keyBinding = new KeyBinding(?, ?, ?...); Quote
Craftit7 Posted July 1, 2021 Author Posted July 1, 2021 Errm, whats the registeratrion method?! Quote
Craftit7 Posted July 1, 2021 Author Posted July 1, 2021 Sorry if im asking alot of questions, Im new to modding. And btw My hobby IS coding, im just not used to coding in eclipse which im forced to do. Quote
Craftit7 Posted July 1, 2021 Author Posted July 1, 2021 11 minutes ago, diesieben07 said: The parameters have names...? They do have names but what does these names stand for? thats the problem. Description is ok. What shall i put in category and keyCode?! Idk what do they mean Quote
kiou.23 Posted July 1, 2021 Posted July 1, 2021 22 minutes ago, Craftit7 said: im just not used to coding in eclipse which im forced to do. you're not forced to code in eclipse. other options are IntelliJ, or VSCode (although vscode requires some setup, and therefore is not really recomended) Quote
InspectorCaracal Posted July 1, 2021 Posted July 1, 2021 1 hour ago, Craftit7 said: Sorry if im asking alot of questions, Im new to modding. And btw My hobby IS coding, im just not used to coding in eclipse which im forced to do. I do all my own coding without an IDE and had to set up Eclipse for this, too, and honestly I'm kind of loving it? The nice thing about being a stickler for simple DIY approaches is you get to fully appreciate modern conveniences when you're forced to try them. Being able to jump right to function declarations by right clicking on them has been a lifesaver for me so far! Quote
Craftit7 Posted July 2, 2021 Author Posted July 2, 2021 Oh wait, I can use IntelliJ with forge modding?! That is gonna be amazing, im gonna try it Quote
Recommended Posts
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.