disable a global event turn on off

Started by Ttecno on Fri, 09/22/2017 - 14:33

Topic category: Advanced modding

Last seen on 20:55, 3. Jan 2020
Joined Aug 2017
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
disable a global event turn on off
Fri, 09/22/2017 - 14:33

I want to create a gui that turns on and off my global event.  It may be a command or keybind if I can't do it. 
If you can help, please do it.

Last seen on 23:11, 12. Jul 2019
Joined Jun 2017
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
You can use variables and
Fri, 09/22/2017 - 21:30

You can use variables and conditions, so when you press something, the variable will go to one or the number needed and because of conditions, things needed to make an event happen, it will happen until you turn it off. This is how to do it:

Set your variables needed and set them to 0, off, and give them names so you can tell which one is which.

Make your event and set the conditions, on the top of the events page, to if number=number, set one to a variable and another to 1.

Make the buttons needed and make them so that when you press it, it turns the variables to 1, which will make them on.

You also need some off buttons to set the variables back to 0, off.

Last seen on 20:55, 3. Jan 2020
Joined Aug 2017
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Thank you,  realy helped me,
Sat, 09/23/2017 - 14:51

Thank you,  realy helped me, but I have alrady a condition, and I'm not suceeed in use booth, it loocks li that:

[spoiler]blockAt[i, j - 1 , k] == Blocks.SAND && VAR:OnOff=1[/spoiler]

Were OnOff is the name of my variable. But I get this error:

[spoiler]

warning: [options] bootstrap class path not set in conjunction with -source 1.6
C:\Pylo\MCreator174\forge\build\sources\main\java\mod\mcreator\mcreator_GlobalEventsTestEnvironmentMod.java:23: error: ')' expected
if(world.getBlockState(new BlockPos(i, j - 1 , k)).getBlock() == Blocks.SAND && VAR:OnOff=1){
                                                                                   ^
C:\Pylo\MCreator174\forge\build\sources\main\java\mod\mcreator\mcreator_GlobalEventsTestEnvironmentMod.java:23: error: ';' expected
if(world.getBlockState(new BlockPos(i, j - 1 , k)).getBlock() == Blocks.SAND && VAR:OnOff=1){
                                                                                           ^
C:\Pylo\MCreator174\forge\build\sources\main\java\mod\mcreator\mcreator_GlobalEventsTestEnvironmentMod.java:23: error: variable declaration not allowed here
if(world.getBlockState(new BlockPos(i, j - 1 , k)).getBlock() == Blocks.SAND && VAR:OnOff=1){
                                                                                    ^
3 errors
1 warning

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileJava'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

[/spoiler]

Last seen on 18:33, 29. Sep 2020
Joined Jun 2016
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
RE:Thank you,  realy helped me,
Sat, 09/23/2017 - 15:34

Try to make a stack event instead of making an & & condition.
The first event is a stack event that has the sand blocl confition and triggers the 2nd event that has the variable condition

Last seen on 20:55, 3. Jan 2020
Joined Aug 2017
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Thanks a lot! You rule! It
Sat, 09/23/2017 - 16:44

Thanks a lot! You rule! It worcked pretty well. I'll post my mod soon.