Tips and tricks for the new procedure system

Published by Klemen on
Tips and tricks for the new procedure system

There have been many questions on MCreator's website on how to use procedure system. We have decided to create a getting started guide for the new procedure system.

We have created a separate wiki page for this purpose. Old event related pages were marked as "legacy" on our wiki, but we will keep them on the website for the users of older MCreator versions.

Many users complained that they can not make things that were possible in event system before. This is not true, however. Just the way how to achieve the same effect is now different. Everything that was possible before is still possible, even with many more options and combinations. This new procedure system is very similar to the one found in Scratch editor. The block system framework we use is called Blockly and is developed by Google. It allows us to make a visual programming experience that was never possible before.

On the procedures wiki page, there are examples of procedures including the explanation of trigger and dependencies. Below, you can see an example of how to make a random possibility condition in the new procedure system.

Random possibility

In this example, we show how to create an if condition that triggers in 70% of the cases. In case it is triggered, the block at x, y, z (these coordinates depend on the trigger that provides actual coordinate values) is removed.

Random possibility of event in the procedure editor

Examples such as the one provided in the citation above and many others can be found on our wiki on the new page dedicated to procedures.

Procedure system wiki page

We will update this wiki page with more examples in the future. If you would like to see a specific example, comment on this post and we will select the best requests and add them to the wiki page. Right now, only some procedures that were most commonly asked are shown. These include examples of how to create conditions that could previously be made using the event condition text box.

Share this:

Comments

I've been using this system a bit, and I'm impressed by how well it works, and how easy to use it is. Nice job!

So, here's what I'm trying to do right now:
I'm trying to create a simple power system, and a lot of it is working.
So far, I've got a block that uses the systems from the other tutorial to turn input items into output items. I also have a generator that will consume a piece of coal to add 16 to a local "energy" variable.
Where I still need help is: How can I read a local variable of one procedure from a different procedure?
For example, If I have a setup of [generator] [wire] [machine] I'll want to have a energy value in the machine read by the wire, and then the energy value being read by the wire measured by the machine, and consumed when the player presses the 'craft' button. Outside that, I don't think there's any form of Forge Energy implementation yet, but ideally I could use that instead of a normal variable, or at least translate that to or from forge energy.

(cont. 1000 characters is kind of a low limit)

Finally, and unrelatedly, because I haven't talked long enough, am I able to do anything at all involving the ore dictionary?

Even if nothing here is actually possible, there are still about a billion new things that I can do with my mod after this update, so thank you for all the hard work!

I am glad to hear you got a good grip of the new procedure system.

Regarding accessing local variables from another procedure, this is not possible as the variables are local. You can use global variables for this purpose, but right now they are global for all worlds. This will be implemented in the future.

We plan to support both energy system and ore dictionary in future updates. There are two active tickets for both of these requests on our issue tracker: https://mcreator.net/tracker

One more thing, as long as I've got you here, would it be possible to change the new-line character in item's description text to something else? I find myself wanting to put commas in like 50% of item descriptions, and other symbols like '~' or '*' essentially never.

@RaolTheBest: Yes, right now they are global per whole local Minecraft session and get reset when one closes the Minecraft. This is a very big limitation that will be fixed in the upcoming updates, where we will make global variables global, stored per world and even introduce location-specific variables later on too.

helllo arlotheEpic, i see what youve done with the proceudre system and i would like to know how you make a generator, if possible could you send me a file of the ptpl ( just export the energy procedures youve made ) and send them to me please, i have a discord, v3Nick#0060

How is possible to make a Random Dungeon Generator with this? i'm planning to do a Random Generated Dungeon with Presetted tiles (like Path, Crossway, Curved way etc) but i don't know how to make those structures randomly generate, can you help me out?
For more contact, Skype:Misterboy64 (italy)

You've seriously opened up the "mod generator" aspect of MCreator. I think it's great how you've integrated the code and the generator - most other programs literally follow what I will call the Vazkii Rule On Mod Generators (because Vazkii said it) - that you only work within a set boundary lest the program frown at you and say "Ni".
I thought code snippets was good, but now procedures (that can have code snippets in :D) really does remove the boundaries, or at least set them as farther out than the world border, and then the snippets of code really destroy the boundaries of this for good!
Congratulations, Pylo, you've pulled it off perfectly again.

A very little and not very important suggestion :
Can you add a warning error when you are naming a variable x, y or z? Because if you make a variable called "x", "y" or "z" it causes recompilation fail (that's because there are already minecraft x, y, z variables; but I didn't know that they are considered variables as the local ones). Also making local variables be able to be renamed would be nice.
(Sorry for bad English)

Renaming variables is close to impossible due to the way procedure system is implemented. But a nice suggestion for the warning. I will implement this in the future update, so if you name the variable as one of the dependencies, you get warned. If you have time, you can open a ticket on a tracker so the request does not get forgotten :) Thanks!

Yesterday I couldn't login. After writing username and password and pressing the butt9n, it said something like "unexpected error, please try again" in a blank page.
It happened both on my computer an my mobile.
After a few time I tried again to login and it said instead that the host was not allowed to login and to contact the admin. I could still login in pylo website.
I even tried to make a new account (Raol) but same error.
Now fortunately it seems to work



Donate to MCreator

By donating to developers you can speed up development, as with more resources, we can dedicate more time to MCreator. It is a free project made by developers working on it in their free time.