Started by
Ttecno
on
Topic category: Advanced modding
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.
Topic category: Advanced modding
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.
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.
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]
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
Thanks a lot! You rule! It worcked pretty well. I'll post my mod soon.