Suggestion: Support for switch statements under "Flow Control" in procedures

Started by thomoski on

Topic category: Feature requests and ideas for MCreator

Joined Jan 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Suggestion: Support for switch statements under "Flow Control" in procedures

Hello!

I've noticed that there often tends to be quite a lot of occasions where a switch statement would be more appropriate than a lot of sequential If-statements when building some more complex procedures and noticed that there is no support for them in the procedure block system. While they're fairly easy to implement myself by locking the procedure and editing directly, that then means if I want to edit the procedure again with the blocks editor, I have to overwrite my custom changes again and re-lock - more of an inconvenience than a proper issue.

I'm not 100% sure if this is possible with the procedure-block-to-java generation system as I'm not 100% familiar, but it would be a nice feature to have if it is.

(Unless there is such a feature and I'm just an idiot - in which case, please point this out)

Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Klemens mentioned beforeā€¦
Thu, 03/28/2024 - 19:07

Klemens mentioned before that switch statements are exactly as resource intensive as a long else if chain and that he doesnt plan on adding this. Unless his opinion on the matter has changed since then