Text Element cannot fetch textfield contents

Started by BittleLit on

Topic category: Troubleshooting, bugs, and solutions

Last seen on 20:07, 9. Feb 2024
Joined Dec 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Text Element cannot fetch textfield contents

So there's a ready piece of text for text elements:

<TextFieldName:Text>

And it always causes compilation errors for both the GUI and Overlay elements:

2021-12-28T12:00:27.266+0300 [INFO] [org.gradle.api.internal.tasks.compile.JdkJavaCompiler] Compiling with JDK Java compiler API.
2021-12-28T12:00:28.769+0300 [ERROR] [system.err] C:\Users\SaN79\MCreatorWorkspaces\health_requirement_mod\src\main\java\net\mcreator\healthrequirementmod\client\gui\TestOverlay.java:39: error: cannot find symbol 2021-12-28T12:00:28.769+0300 [ERROR] [system.err] Minecraft.getInstance().font.draw(event.getMatrixStack(), "Text is " + TextFieldName.getValue() + "", posX + -72, posY + 86,
2021-12-28T12:00:28.770+0300 [ERROR] [system.err] ^
2021-12-28T12:00:28.770+0300 [ERROR] [system.err] symbol: variable TextFieldName
2021-12-28T12:00:28.770+0300 [ERROR] [system.err] location: class TestOverlay
2021-12-28T12:00:29.264+0300 [ERROR] [system.err] 1 error

What exactly happened here and how do I fix it?

You need to replace this…
Tue, 12/28/2021 - 15:16

You need to replace this with your actual text field name you placed in the GUI, it is only a placeholder

Last seen on 20:07, 9. Feb 2024
Joined Dec 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
how exactly? <TextFieldName:…
Wed, 12/29/2021 - 11:47

how exactly? <TextFieldName:[My name]>?

 

Last seen on 20:07, 9. Feb 2024
Joined Dec 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
or <[MyName]:Text>?
Wed, 12/29/2021 - 13:14

or <[MyName]:Text>?

Last seen on 20:07, 9. Feb 2024
Joined Dec 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
PLEASE HELP HOW DO I DO IT
Fri, 01/21/2022 - 13:49

PLEASE HELP HOW DO I DO IT

Last seen on 20:07, 9. Feb 2024
Joined Dec 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
NVM FIGURED IT OUT
Fri, 01/21/2022 - 13:59

NVM FIGURED IT OUT

Last seen on 20:07, 9. Feb 2024
Joined Dec 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Just type like such: (your…
Fri, 01/21/2022 - 14:01

Just type like such:

(your text) <TextFieldNameOfYourTextField> (more text)

So just dont use the colon. Gonna test if this works rn.

Last seen on 20:07, 9. Feb 2024
Joined Dec 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Nope, it writes something…
Fri, 01/21/2022 - 14:12

Nope, it writes something like "net.v something.mcreator" and something and then goes off the screen.

Last seen on 20:07, 9. Feb 2024
Joined Dec 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
god how do i do it??????????…
Fri, 01/21/2022 - 14:14

god how do i do it??????????????????????????????????????????????????????????

Last seen on 20:07, 9. Feb 2024
Joined Dec 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
YESSS I MADE IT WORK!
Fri, 01/21/2022 - 14:22

YESSS I MADE IT WORK!

Last seen on 20:07, 9. Feb 2024
Joined Dec 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Just make it like this: …
Fri, 01/21/2022 - 14:25

Just make it like this:

(text) <TN:text> (more text)

Note: TN is the name of your textfield. It MUST exist first or errors will pop up until you make one with that name as its machine name.

Note: for whatever reason text MUST be after the textfield name.

 

But, most importantly, it works.