Jump to content

[Solved] Block Update


Recommended Posts

What are the ways to do a block update? I have a block that need a change every minecraft day. i know of setTickRandomly() or using ticking tile entity but the first one is not something i have in mind and i really dont like ticking tile entities specially since the block updates so less frequent and there might be not few of them (its something like a regenerating ore). I thought of making some kind of list, subscribe to a world tick event and then when time is right update the list. but can blocks even be updated in unloaded chunks? 

i do have a way using random tick in mind though.

Edited by Flemmli97
Link to comment
Share on other sites

If you need 100% accurate time, you must use a TileEntity.


If you don't you can either rely on random ticks (which works fine for things like growing crops, although I've edited that logic to hell, myself).


Or you can use world.scheduleBlockUpdate and pass in a sufficiently large number. I don't recommend using 24000 ticks as the "delay" but to try and encode some of the regrowth in the block's metadata (it doesn't need to change visually). You would still want random update ticks in case the scheduled tick never occurs (again, why to use metadata for some of it: if the scheduled tick gets skipped for any reason, you're only out 6000 ticks, not 24000!).

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.


Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.


DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
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.
Note: Your post will require moderator approval before it will be visible.

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

×   Pasted as rich text.   Restore formatting

  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.

  • Create New...

Important Information

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