How to Use Conditions

Works with

​What is a condition

Conditions are one of the newest features that came with MCreator 2020.4 and allow you to require a condition for an event.

How does it work

With MCreator 2020.4 we now have "return" procedures and conditions work using these return values.

Using conditions

Like I said before conditions work using return values but something like below WON'T WORK!

It must be something like one of these instead:

This condition will return false if player is not holding a diamond in its off-hand and will return true if holding. If it returns true, our condition will be met.

This means if a player is holding the diamond in its off-hand it will return true, if not it will return false. If it returns true, our condition will be met.

The main diffrence between these conditions is that the first one has a default return value of false and will return a value only if player is holding a diamond in its off-hand. But the second one can return true or false without having a default value. But they still do the same thing so it's your choice.

Example condition usage

Now let's use this with a dimension portal as an example. Start creating your dimension, check out How to Make a Dimension wiki page if you come across with a problem. Now when you came to the portal section of dimension creation, you will see two available condition slots to the bottom of the page like these.

One for making the portal and another for traveling through the portal. Let's put our condition to portal creation. Now when you test the portal, you'll see that you can't create the portal without having a diamond in your off-hand.


Video tutorial

How to use conditions

If you prefer watching a video, you can find a video tutorial about using conditions below:

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.