Open Guimoute opened 1 year ago
I would make the events take a single block
argument which is the block being ticked. This allows the usage of block-based functions directly on the block passed in instead of having to do block(x, y, z)
on the three coordinate arguments.
Furthermore, the event should allow cancelling vanilla behavior by returning 'cancel'
.
This can be used for example to stop water/lava flowing or to simulate a fractional value for the randomTickSpeed
gamerule.
@James103 Very good points. We can add more examples of use cases:
Fluid ticks:
Random ticks:
water source surrounded by enough blue ice freezes regardless of the biome temperature.
Block ticks:
Hello, I think it would be interesting to have new events to track random/block/fluid ticks in Scarpet:
__on_random_tick(x, y, z)
would trigger once for each of therandomTickSpeed
blocks randomly selected per chunk tick. This would allow scripters to change things like plant growth, ice formation, etc.__on_block_tick(x, y, z)
for scheduled block ticks.__on_fluid_tick(x, y, z)
for scheduled fluid ticks. This would make it possible to override what happens when lava/water flows.For context, those came to mind because I wanted to extend the behavior of
renewableBlackstone
andrenewableDeepslate
from Carpet and add a system to create easily anylava + water + <block1> = <block2>
recipes. It is not doable with__on_tick()
. Such a script would be based on the__on_fluid_tick
event only, but I still suggested the two other events because they fall into the same "world action" event category.