Started by
Ro...
on
Topic category: Help with modding (Java Edition)
Hi, i create few custom vines in my mod, i want them to spawn under leaves, since they are like the Crimson Forest vines from 1.16 nether update. i want to know how to make that each 1 ticks the vines check if the block above it is air, and if it is, then it destroy itself, i tried to do that and it works, but if the vines is auto-generated, it wont works. Any way to fix ti? and also, i want to make that each 20,000 ticks, if the block at y-1 of the vines is air, than it place another one just under it but i dont know how to make a 1 tick procedure and a 20,000 ticks procedure that work at the same time.
i also want make but no idea
i've made proper hanging vines before and am confident enough to say that i fully know what to do in this case. so here's the thing:
1. don't make it check the block above per 1 tick if you say it can be naturally generated, as naturally-generated blocks do not tick at a constant rate (and thus are actually affected by random tick speed due to performance reasons). that means the procedure will mostly fail. it'll only tick at a constant rate that you've set for it in the block advanced properties if it was actually placed by a player. instead, use the "neighbor block changes" trigger, which executes immediately after a block that's next to another block changes, no matter what.
so in that trigger, the procedure should be like this:
"if [is air at x y+1 z], do [wait 1 ticks then on server-side, do remove block at x y z]"
note that the wait [x] ticks there is optional as that's only for making the vine break in a similar way like weeping vines wherein all connected vines don't instantaneously break; i recommend rechecking the behavior of broken weeping vines if you don't know/didn't notice that yet
2. again, don't make it check per [x] tick; that's a horrible way of doing delayed things for both technical & aesthetic reasons: the waiting time is constant plus the block also naturally generates which wouldn't really make it reliable, AND it simply looks & feels unnatural. instead, use random tick, so make sure your vine block is set to tick randomly. then on your vine's update tick trigger, put the procedure: "if [is air at x y-1 z], do [place your vine block at x y-1 z]"
that way, they'll both execute at the same time