Posted January 30, 20187 yr 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 September 7, 20187 yr by Flemmli97
January 30, 20187 yr 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.
January 31, 20187 yr Author @diesieben07 update in the sense of changing the block to another. @Draco18s thx, ill look more into scheduledBlockUpdate
January 31, 20187 yr Author update: i do think i have to use tile entities since i also want to make it "time-skip" combatible (sleeping).
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.