Plant Growth Time Update

Started by Fox_trot on Tue, 09/24/2019 - 06:05

Topic category: Help with MCreator modding

Last seen on 03:44, 20. Oct 2019
Joined Sep 2019
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Plant Growth Time Update
Tue, 09/24/2019 - 06:06 (edited)

Hello all,

I'm trying to make a plant similar to that of the sweet berry bush in 1.14. My issue is with time, how can I delay the plant growth with procedures?

I have looked at tutorials but I am still confused.

Thanks

Edited by Fox_trot on Tue, 09/24/2019 - 06:06
Last seen on 11:09, 23. Oct 2019
Joined Aug 2019
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
You could make a procedure…
Tue, 09/24/2019 - 08:29

You could make a procedure that sets a local variable to Random [0,1], and then make an if statement that tests if this is for example above 0.9, and put the plant growing in that.

Last seen on 03:44, 20. Oct 2019
Joined Sep 2019
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Oooh interesting, if I make…
Tue, 09/24/2019 - 08:57

Oooh interesting, if I make the probability greater then 0.9999 and it checks every update tick this might just work.

This should give a chance of one in ten thousand which should be equivalent to an average growth after 10,000 ticks or 8.3 minutes. Hopefully...

Anyway thanks

Last seen on 13:19, 23. Oct 2019
Joined Aug 2019
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
If you don't want to use…
Tue, 09/24/2019 - 10:21

If you don't want to use randomness but actually set a specific time:

PROCEDURE:

On tick update:

if Nbt number tag "counter" > (time in ticks)

do set nbt number tag "counter" = 0

do (Whatever you want the plant to do when it should be growing)

else

     set nbt number tag "counter" = get nbt number tag "counter" + 1

Requires blocks ability to store NBT data. Initialise counter on block added if it's null value isn't 0.

If you want to combine the counter with randomness you can add such an if statement inside the Else statement, slowing down incrementation of the counter nbt number tag. This will still ensure that the minimal time your plant needs to grow is equal to (time in ticks)

Last seen on 03:44, 20. Oct 2019
Joined Sep 2019
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Cheers. I'll try out both…
Wed, 09/25/2019 - 02:58

Cheers.

I'll try out both ways and see which one works best!