November 5, 20186 yr 12 minutes ago, D0XY said: For obvious reasons, this method and robot.delay() freezes your Minecraft. Is there an efficient way to do this without lagging? Count ticks in a tick event, ie ClientTickEvent VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
November 5, 20186 yr 55 minutes ago, Animefan8888 said: Count ticks in a tick event, ie ClientTickEvent Or as I'm sure you've guessed, if it's for the server, ServerTickEvent
November 5, 20186 yr 4 hours ago, Laike_Endaril said: Or as I'm sure you've guessed, if it's for the server, ServerTickEvent The robot class in java exists to simulate mouse/keyboard input. The server doesn't care. It doesn't even listen to any input.
November 5, 20186 yr 4 minutes ago, V0idWa1k3r said: The robot class in java exists to simulate mouse/keyboard input. The server doesn't care. It doesn't even listen to any input. On a dedicated server, or on the client when in LAN mode, you have access to the server console commands (though in the latter you still have ClientTickEvent anyway). I just wasn't sure from the OP's post whether he was talking about typing something in *on the client* or typing something in *on the server*, since it wasn't specified. Or am I missing your point? By "server" do you mean a certain part of the server that we have access to, or the entirety of the server, including the command console?
November 5, 20186 yr 7 minutes ago, Laike_Endaril said: On a dedicated server, or on the client when in LAN mode, you have access to the server console commands 7 minutes ago, Laike_Endaril said: Or am I missing your point? By "server" do you mean a certain part of the server that we have access to, or the entirety of the server, including the command console? Well you could type into the console with a robot, sure, I guess. There is no console on an integrated server though, only the dedicated. Chat messages are typed on a client, then sent to a server. I meant the logical server.
November 5, 20186 yr 16 minutes ago, V0idWa1k3r said: There is no console on an integrated server though, only the dedicated. Chat messages are typed on a client, then sent to a server. I meant the logical server. Right, got it.
November 6, 20186 yr 15 minutes ago, D0XY said: How can I resume a loop after it reaches the needed ticks? You are thinking about it the wrong way. Have a counter field that gets decremented in the tick event. When it reaches zero type your key and set it to the delay you want.
November 6, 20186 yr 13 minutes ago, D0XY said: How can I resume a loop after it reaches the needed ticks? I assume have a counter, increment that counter every tick, and only act if the delay has been reached (pseudocode) private static int counter = 0; //inside tick event { counter++; if((counter % interval) == 0) { //do stuff } } or to add pseudocode for @V0idWa1k3r's answer private static final int DELAY = 1 * 20; //1 second; private static int delayCounter = DELAY; //inside tick event { delayCounter--; if(delayCounter == 0) { delayCounter = DELAY; //do stuff } } Edited November 6, 20186 yr by Cadiboo About Me Spoiler My Discord - Cadiboo#8887 My Website - Cadiboo.github.io My Mods - Cadiboo.github.io/projects My Tutorials - Cadiboo.github.io/tutorials Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support. When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible. Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.