Text Element cannot fetch textfield contents

Started by electrovoyage. on

Topic category: Troubleshooting, bugs, and solutions

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?

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]>?

 

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>?

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

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

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.

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.

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??????????????????????????????????????????????????????????

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!

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.