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');
}
}
});
}); ```
#script not working, what do I change
1 messages · Page 1 of 1 (latest)
It's now blockComponentRegistry not blockTypeRegistry
Okay, I should've changed the forum to solved, however I ran it through the debugger and it said it's bug free however it doesn't seem to be working
Also yes I changed the block registry stuff a few hours ago