Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

Hello everybody!

 

After working on some time related mechanics, i ran into question: how often block.updateTick is normally called?

It's for sure not every tick, that's what are my results for now...

 

Thanks for help!

If you have any questions - just ask!

It can be every tick, but normally it's not called at all unless you specifically schedule an update tick (which you could do every single tick). For blocks that are set to tick randomly, it is called somewhat regularly based on the tick rate you return from tickRate(World).

  • Author

It can be every tick, but normally it's not called at all unless you specifically schedule an update tick (which you could do every single tick). For blocks that are set to tick randomly, it is called somewhat regularly based on the tick rate you return from tickRate(World).

So basically, if it returns 10 it means each 10th tick? Or each tick with 1 chance out of 10?

Thanks so much!

  • Author

based on the tick rate you return from tickRate(World).

This is not true. You cannot specify the tick rate for random ticks. The tickRate method does nothing.

Apearently, yes. Going though call hierarchy of tickRate showed only BlockStairs and only BlockStairs.

Then how often/with which chance is updateTick called?

  • Author

If you do nothing it is not called at all.

If you do setTickRandomly(true) it will be called randomly, see the Minecraft Wiki for details.

If you call world.scheduleBlockUpdate it will be called as many ticks later as you specified there.

So basically each block has one chance out of 1365 to be ticked. That's interesting...

based on the tick rate you return from tickRate(World).

This is not true. You cannot specify the tick rate for random ticks. The tickRate method does nothing.

Are you sure? When I tested it out before, it definitely seemed to affect how often the updateTick method was called, but that was way back in 1.6.4, of which my memory is a bit foggy, so...

 

Hm, yeah it seems tickRate isn't really used anywhere other than (in 1.8) for trip wire hooks which use it when scheduling a block update, and in Forge's BlockFluidFinite class. In 1.7.10, it's only used for stairs, and not really even there because it just returns a different block's tick rate.

 

Really makes one wonder sometimes, doesn't it? It's probably legacy code that Mojang just hasn't gotten around to removing (I hope).

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.