Procedures not working when generated

Published by AOCAWOL on
Status
Fixed
Issue description

So I made leaf decay procedures for all my leaf blocks and they worked fine when I was placing them. But when I put them in a structure as a tree and they generated. The decay procedure tied to them doesn't work at all for some reason?

Issue comments

If there is anyway this bug fix could come in a hotfix instead of waiting for the 2019.5 because this is a heavy issue for like my entire mod as it's dependent on procedures.

Unfortunately, tick update is not started on its own as there are no events triggered by default when the block is spawned in the world to prevent extreme lag that would cause.

The way around this I would take is the following: Use neighbor block changed the procedure and on this procedure, the ticking should be started. There is no procedure to schedule a tick update yet, we will consider adding it. For 1.14.4, you can use the following code in the custom code procedure block:

world.getPendingBlockTicks().scheduleTick(new BlockPos(x, y, z), world.getBlockState(new BlockPos(x, y, z)).getBlock(), 0);

 

If there is anyway this bug fix could come in a hotfix instead of waiting for the 2019.5 because this is a heavy issue for like my entire mod as it's dependent on procedures.

We do not release hotfixes this deep in the release, the purpose of snapshots is to isolate such bugs by early testers as late patches would confuse users as many would not have them. I will release this in 2020.1, but for now, use the workaround I provided.

I don't know if I can reply to this thread. If I'm not supposed to, please feel free to remove.

How would one use this new procedure block? I'm trying to create an ore that, when naturally spawned, should transform into some other block.

I've created a procedure with the new "schedule tick update" block and assigned it to the "when neighbour block changes" slot in my ore. Now it works when I change one of the surrounding blocks to my ore (obviously) but it still doesn't happen naturally, when the ore is generated. I fear I have misunderstood this thread and what I want is not really possible.

Ores generated by Minecraft can not tick by the design of the game to prevent overloading if you want another block instead of this ore to generate, enable generating for such block instead.

On block added is not triggered as well as far as I know for the same reason.

One way around this is to use structure spawn mod element and use on structure spawned mod element to manually trigger ticking of desired blocks from there.

If this is the case, you can use on block added to use schedule tick update and the block will start ticking.