#script not working, what do I change

1 messages · Page 1 of 1 (latest)

solemn dune
#
import { world } from '@minecraft/server';

world.beforeEvents.worldInitialize.subscribe(evt => {
    evt.blockTypeRegistry.registerCustomComponent('sniffer:hatch1', {
        onRandomTick: e => {
            const { block } = e;

            if (Math.random() < 0.3) {
                block.setType('sniffer:hatch_2');
            }
        }
    });
}); ```
gaunt isle
solemn dune
#

Also yes I changed the block registry stuff a few hours ago