structure gen is not getting update ticks

Started by TheRidiculousR on

Topic category: Help with modding (Java Edition)

Last seen on 10:28, 25. Nov 2022
Joined Feb 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
structure gen is not getting update ticks

Hello, I have been working on a mod that adds several biomes with crazy trees to the game, which I have been doing using structures and the "on structure generate" event.
all of the trees I made previously simply place a structure of one log, and the procedure places all the blocks for true randomisation abilities.

I wanted to make a more simple tree as well, using placeholder blocks that automatically turn into something else when they have an update tick.
an example is the blocks at the top have a random chance to turn into either leaves or air, and the grass on the trees has a chance to turn into taller grass, flowers, or also air. (they ancient and overgrown themed trees, plants can stand on them)

what I did first was make a procedure that essentially scans the tree as it generates to check what should happen to which block, but this ended up crashing the game as it was "accessing chunk out of bound"

my second approach was to make dedicated blocks with each their own purpose, which does work fine for the most part - but some times there's no block updates happening and the trees remain made out of placeholder blocks until a user clicks on them.

as this clearly still wasn't my intended result, I instead made the structure a single block which then triggers a procedure which places and updates the tree via structure - but as it turns out, structures do not get placed on this "on generate" event, and I made sure it wasn't the procedure getting called incorrectly somehow as placing individual blocks work fine but the structures flat out don't appear at all.

if anyone got any tips on how to properly cause these structures to generate within the event procedure, or how to make the structure spawned trees do a tick update, i'd be really happy!
thanks in advance 

Only blocks that tick…
Wed, 03/10/2021 - 09:15

Only blocks that tick randomly will trigger ticks. 

This is by MC design as ticking all generated blocks would lag the game badly