"List.of" not defined: Custom code

Started by rexyDos on Sat, 07/02/2022 - 23:02

Topic category: Help with modding (Java Edition)

Last seen on 17:01, 18. Jul 2022
Joined Aug 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
"List.of" not defined: Custom code
Sat, 07/02/2022 - 23:02

Before I get started, I don't want to come off as incompetent. Asking here is my last-ditch effort to solve this error.

I'm using IntellijIDEA, adding custom code to a mod element(specifically a block). I was reading about the block feature class, and I noticed that the static method List.of was not defined. This makes developing custom code for the mod item a bit more difficult as it causes errors.

I read that the JDK version List.of was first included in version 9, so I downloaded and set my project JDK version to version 9, but this didn't seem to make the error go away. I tried JDK 11, 17, and 18, yet none of those versions included List.of. I went to stackoverflow to see if I was changing the JDK version right, and I was. Another thing I found odd was, when using MCreator's code editor, the definition for List.of was not found.

I'm here because I'm hoping someone else in this community had this same error and managed to fix it because I'm out of ideas.

 

If someone can help me, I would greatly appreciate it!