Started by
DragenSlayor
on
Topic category: Help with MCreator software
Is there any way to wait in between each action in procedures? I'd like to know if theres a way.
Edited by DragenSlayor on Mon, 11/19/2018 - 16:54
Topic category: Help with MCreator software
Is there any way to wait in between each action in procedures? I'd like to know if theres a way.
You might try the custom code snippet (under advanced) and add
Where "X" is number of milliseconds to wait. This appears to compile properly, but I cannot test operation.
I have already replied in the mcreator news, anyways, here is a copy+paste
Actually a procedure is a Minecraft tick (1/20 seconds), so the only way for doing so is adding a global variable, then adding something that makes the global variable increase at the end of the procedure and adding an "if" condition that checks the value of the variable, does something and resets the variable. Rember to put big numbers in the "if" condition (if you'll put 100 it will wait 5 seconds, 100:20=5) Sorry for bad English
how to make it increase at the end of the procedure?
oh any way to make a cooldownw procedure?
Set Variable x (GetVariable x +1)
can u sed me a pic?
Bro Raol Plz answer
OMG
I'm not in front of my computer but i think this is what he's getting at.
edit: step 2: put that logic into the while slot.
edit 2: step 9 and following; on second thought, better put those if functions into the while loop. :weary: this whole thing inefficient and cludgy but if you're absolutely certain thread.sleep(X) won't work for your purposes...
my understanding is that thread.sleep() will count actual time and the while loop will count ticks. This means if the server is lagging, there might be a significant difference in amount of time measured.
C:\Users\Feather\Desktop\MCreator179\forge\build\sources\main\java\mod\mcreator\mcreator_lol.java:26: error: incompatible types: possible lossy conversion from double to int
mcreator_VarListtestenvironmentmod.One = ((double)(mcreator_VarListtestenvironmentmod.One+1));if ((mcreator_VarListtestenvironmentmod.One==100)) {if(entity instanceof EntityPlayerMP){
^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error
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.
i got a error
I can't tell if mcreator uses threading or if the mods are jammed into the main thread. I assumed multithreading but it looks like I'm wrong.
It looks like forge has a specific tick handling set of functions, but it will require editing the actual code, try reading through
https://www.minecraftforum.net/forums/mapping-and-modding-java-edition/…
@feather4011 post a screenshot of your events?
gimme ur discord so i can sned it to u
So the problem is that the variable that you mention to make a cooldown system is local, which means it can only be called in that procedure. Which also means that even if you have the while loop counting down, that number is basically void after the procedure is done or is called again since the while loop would keep on resetting it self. Which leads to the other problem regarding variables in MCreator, the only 2 type of variables that you can use are local and global both of which cant be used to specify a variable for one object or player. I have tried this before and my only other solution is making a some sort of item that prohibits the player from using the ability or what ever is on cooldown.