How do you insert User Code Blocks (2024.1)

Started by smmmadden on

Topic category: Help with modding (Java Edition)

Last seen on 17:59, 29. May 2024
Joined May 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How do you insert User Code Blocks (2024.1)

In 2024.1 a new edition to insert User Code Blocks was introduced and a screen shot showing the code, but no screenshot or information was provided on how to get to that screen. Can someone please provide the first step in getting there? The question has been asked a few times but no one has provided the answer.  Thanks!

User code blocks are pre…
Wed, 04/17/2024 - 06:53

User code blocks are pre-inserted into regions of the code (into base mod files) where they are needed the most.

You can find a demo I prepared yesterday at this URL: https://twitter.com/i/status/1780317122477871431

FAQ of some questions people asked so far:

Why not do it in other class files?

Our internal team picked quite some common locations where those blocks are needed, including mods.toml. If more are needed, we accept PRs adding them on suggested places.

Isn't it possible to let users choose where to put them?

Anchoring text in an arbitrary position when the previous anchor can change during code generator changes and data model changes is not a trivial task. This is why most code generators use the comment anchor approach that we decided to adopt in our software.

Last seen on 17:59, 29. May 2024
Joined May 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Not sure why you posted it…
Wed, 04/17/2024 - 11:45

Not sure why you posted it on Twitter.  But the video goes so fast, I still cannot see what you clicked on to get the code to show up so that user code block could actually be inserted.

Not sure why you posted it…
Wed, 04/17/2024 - 14:25

Not sure why you posted it on Twitter. 

We do a lot of announcements on our social channels so I recommend keeping an eye on our socials ;)

see what you clicked on to…
Wed, 04/17/2024 - 14:24

see what you clicked on to get the code to show up so that user code block could actually be inserted.

I have clicked on the file name in the project file browser. Double-clicking files there opens them

Last seen on 17:59, 29. May 2024
Joined May 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
okay - I don't use twitter…
Wed, 04/17/2024 - 14:57

okay - I don't use twitter or have an account there.  I see now how you go there.  Your first step was clicking on "Window" menu option, then "Show workspace file browser".  That then shows all the files in the left pane.  That's what I've been asking how did you get the list of files.  Not an option I ever needed to use. :-)

That's what I've been asking…
Wed, 04/17/2024 - 17:23

That's what I've been asking how did you get the list of files.  Not an option I ever needed to use. :-)

Yes, it is more meant for users who heavily utilize custom code :)

okay - I don't use twitter or have an account there

Most unofficial MCreator discords relay posts from X/twitter. Alternatively, you can also find announcements on our YT channel or subreddit, but more important stuff is also announced on the website, of course