Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

I have made a textbox/textfield or whatever you want to call it but I want to be able to get the characters that were typed there, how can I do this?

Assuming that you're using the GuiTextField or a subclass, you can use GuiTextField#getText.

Fancy 3D Graphing Calculator mod, with many different coordinate systems.

Lightweight 3D/2D position/vector transformations library, also with support for different coordinate systems.

  • Author
29 minutes ago, SerpentDagger said:

Assuming that you're using the GuiTextField or a subclass, you can use GuiTextField#getText.

How do I do that? Like for example, will I do like "public void GuiTextField#getText" (Just to come up with one, but it obviously won't be void)? To be honest I am not that good with Java but I know some things I guess.

getText() is already a method in all instances of GuiTextField, so you don't need to make a new one for it. Just call the method on your GuiTextField object, and it will return the text contained by said object.

As a side note, I'd suggest you get much more familiar with Java in general before trying to do anything complicated with Forge, as it's not very beginner-friendly in places.

Fancy 3D Graphing Calculator mod, with many different coordinate systems.

Lightweight 3D/2D position/vector transformations library, also with support for different coordinate systems.

  • Author

I haven't done really anything in terms of creating Guis in Minecraft/Forge so that is why I don't really know, because when I make something in Forge it is basically the same topic so my learning doesn't really go anywhere but today I thought I would give making a Gui a shot.

13 hours ago, Premiere said:

I haven't done really anything in terms of creating Guis in Minecraft/Forge so that is why I don't really know, because when I make something in Forge it is basically the same topic so my learning doesn't really go anywhere but today I thought I would give making a Gui a shot.

Check out, my GUI class. When the class is initialized, I set class level variables to each part of my gui that I needed. That way, when the buttons are clicked(or any event really) I can test aginst my objects. Same applies to you, onAction -> getText 

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.