Jump to content
  • Home
  • Files
  • Docs
Topics
  • All Content

  • This Topic
  • This Forum

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • Queing changes in the world to Tick
Currently Supported: 1.16.X (Latest) and 1.15.X (LTS)
Sign in to follow this  
Followers 0
ArmamentHaki

Queing changes in the world to Tick

By ArmamentHaki, December 23, 2018 in Modder Support

  • Reply to this topic
  • Start new topic

Recommended Posts

ArmamentHaki    2

ArmamentHaki

ArmamentHaki    2

  • Creeper Killer
  • ArmamentHaki
  • Members
  • 2
  • 114 posts
Posted December 23, 2018 (edited)

Hello, 

I want a change in the world to happen after some time e. G. Changing a block position tick by tick. My idea was to use the server tick event and "queue" different changes. For instance there could be something happening 3 ticks after clicking an item. Are there any easier ways to do this implemented by forge? 

 

Edit: I will try using entities for this purpose first

Edited December 23, 2018 by ArmamentHaki
  • Quote

Share this post


Link to post
Share on other sites

diesieben07    7596

diesieben07

diesieben07    7596

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7596
  • 55098 posts
Posted December 24, 2018

Tick events are the correct way. Do not use entities.

  • Quote

Share this post


Link to post
Share on other sites

jabelar    593

jabelar

jabelar    593

  • Reality Controller
  • jabelar
  • Members
  • 593
  • 3266 posts
Posted December 26, 2018

For your original question, yes the approach of having a simple "queue" for scheduling things should work. The actual mechanics of the queue can be coded in different ways depending on how many things and how far in time you want to queue things. Unless there is a performance concern due to having a huge number of scheduled events, almost any sort of collection can be used that you cycle through.

 

One detail is that if you're doing this for worlds that might be saved, you'll probably want the time to continue when the world is loaded again. In that case, you should also save the queue to world save data or maybe the player data depending on what sort of things you're scheduling.

  • Quote

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

    • Insert image from URL
×
  • Desktop
  • Tablet
  • Phone
Sign in to follow this  
Followers 0
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • ju_
      Minecraft crashes while launching - failed to find service port for display

      By ju_ · Posted 5 minutes ago

      Hi, to follow on the subject i have the same issue https://pastebin.com/E47LtT43 it works fine on my end with vanilla or other version. i only have this issue with forge for 1.16
    • poopoodice
      What is the method to left click?

      By poopoodice · Posted 21 minutes ago

      Check Minecraft#processKeyBinds where it checks for attack keybind (left mouse).
    • kiou.23
      Mod won't load when in dev environment

      By kiou.23 · Posted 22 minutes ago

      You need to update the build.gradle to have your modid instead of the default examplemod you'll want to modify the group, the modid and pretty much everywhere where "examplemod" is shown, you'll want to replace with your own modid   note: you have a static field in your main mod class (Warwolves.java) called MOD_ID, whenever you need the mod id, you should be referencing this field, instead of typing the string every time note 2: don't create an ItemBase class https://championash5357.github.io/ChampionAsh5357/tutorial/minecraft/ciar#code-style-5
    • BoGuBoy
      3rd party hosted Server wont launch

      By BoGuBoy · Posted 26 minutes ago

      Thanks for the reply i got a response from the head support so ill look into changing hosts thanks for the quick response bud
    • Gubipe
      What is the method to left click?

      By Gubipe · Posted 1 hour ago

      I am trying to make a custom autoclicker for my client side mod which will be used on my smp server so that when someone presses down the key "v" it will toggle an autoclicker for them. I was wondering if anyone could tell me what the method is to register a left click? I would appreciate it!
  • Topics

    • schmiddi_0
      16
      Minecraft crashes while launching - failed to find service port for display

      By schmiddi_0
      Started December 14, 2020

    • Gubipe
      1
      What is the method to left click?

      By Gubipe
      Started 1 hour ago

    • Silivek
      1
      Mod won't load when in dev environment

      By Silivek
      Started 5 hours ago

    • BoGuBoy
      2
      3rd party hosted Server wont launch

      By BoGuBoy
      Started 5 hours ago

    • Ronshark
      1
      tempête de Neige primal winter

      By Ronshark
      Started 4 hours ago

  • Who's Online (See full list)

    • ju_
    • Otep
    • Cloven
    • FloweyTF
    • PyRoTheLifeLess
    • kiou.23
    • Leronus
    • Squrikle
    • AdleyMD
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • Queing changes in the world to Tick
  • Theme

Copyright © 2019 ForgeDevelopment LLC · Ads by Longitude Ads LLC Powered by Invision Community