#Need help with custom leaves decay
1 messages · Page 1 of 1 (latest)
Theres kaiogas example repository, the page for leaves is here: https://github.com/Kaioga5/Kaioga-s-Block-Templates/tree/main/templates/1.20.80/leaves
That is a bit out dated, so might need to be modified to work
Logically you’d have leaves spawned from tree growing to have a custom compo t and use on_random_tick to replace the block with air and run a loot table for stick and sapling… IF no connected wood blocks to the leaf block.
The search for wood in a volume around the leaf would stop the decay from occurring.
For leaves placed by the player do t have the custom component applied. So they wont decay ..
Reading that template - that’s pretty much what it does
I wonder if there’s a more efficient way to do the connected to log test to avoid needing to check as many blocks 🤔
I dont think so. It will still have to check every block, this method means it doesn't check the same block multiple times though
I don't know why, but the leaves template never worked for me, so I made my own based on the template and multiple other refrences to make my own custom. It works, but not the best.
i was wondering if a block could just quey its 6 adjacent ones - with each aware if they were attached to a log.. then change with "on player destroy" the state of blocks surrounding a log.. moving the work to just when the tree is felled (or reducing at least) vs dong it for each "on random tick"
would add more permulations though
it would definately work, and should be less laggy as its done once not repeatedly and only on a change to the "tree" and/or leaves