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

Started by poolcool2 on

Topic category: Help with MCreator software

Active 5 years ago
Joined Jan 2018
Points:
705

User statistics:

  • Modifications: 0
  • Forum topics: 3
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 5
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

Active 4 years ago
Joined Jun 2016
Points:
3744

User statistics:

  • Modifications: 10
  • Forum topics: 39
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 5484
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

Active 5 years ago
Joined Jan 2018
Points:
705

User statistics:

  • Modifications: 0
  • Forum topics: 3
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 5
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.

Active 5 years ago
Joined Jan 2018
Points:
705

User statistics:

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

Ok thanks