How do I add 2 "if"s to 1 event

Started by poolcool2 on

Topic category: Help with MCreator software

Joined Jan 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How do I add 2 "if"s to 1 event

My goal was to make it so if a variable was true and a random number was selected it would do something using events

I tried "isVariableTrue[<Variable name>],(int)(Math.random()*2)=2"

and "isVariableTrue[<Variable name>];(int)(Math.random()*2)=2"

and ""isVariableTrue[<Variable name>]" + "(int)(Math.random()*2)=2""

all of them gave errors and I ran out of ideas to try, I looked all over and it seems nobody had the same question and the wiki never mentioned this

I replaced where I had the variable with "<Variable name>" as to not spoil my project

I also have not found a way to get around this problem but it seems impossible without having 2 "if"s

Joined Jun 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Try to use a stack event…
Thu, 01/25/2018 - 08:41

Try to use a stack event instead of using only an event for both conditions

Joined Jan 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I don't fully understand…
Thu, 01/25/2018 - 14:46

I don't fully understand what you mean

You select stack event event…
Thu, 01/25/2018 - 17:54

You select stack event event result and add the first condition and then on the stacked event, add another condition and desired event result.

We plan to include logical expressions in condition field in the future.

Joined Jan 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Ok thanks
Thu, 01/25/2018 - 19:53

Ok thanks