mojira.dev
MCPE-236362

Custom blocks with scheduled ticking may tick more than intended when generated in a structure

Custom blocks can use the minecraft:tick component alongside custom scripting hooks to run an event on a (semi-)reliable timer. When saving a structure, tick data is retained in the saved NBT-backed mcstructure file. When this data is retained as part of a structure provided via a behavior pack, custom blocks fire events more rapidly than specified.

The given tick data in the structure should be respected and the provided values from minecraft:tick should only be used once that first countdown has reached 0. Also note that, while not demoed here, this bug has also been observed with structures referenced from structure template features.

Demonstration

The attached videos show the bug at play. A custom block is provided that is configured to run an action every 40 ticks (2 seconds).

  • The control case (red concrete base) shows scheduled ticking working as intended.

  • When loaded as part of a structure that retained its tick data (green concrete base), the block ticked twice every 40 tick interval: once as specified by its tick data (see attached screenshot) and again on the 40th tick as if that data were not provided.

  • When loaded as part of a structure whose tick data was wiped (blue concrete base), the block ticked correctly.

Reproduction

These demo videos are taken from the behavior pack in the attached world for convenience. This world can be opened (in Minecraft Preview) for inspection or unzipped to access the code associated with such.

Attachments

Comments 1

Thank you for helping us improve Minecraft! We saved your files:

[media][media][media][media][media]

Ciosciaa

(Unassigned)

1565935

Confirmed

Multiple

26.10.23 Preview

Retrieved