import {
  world,
  EntityDamageCause
} from "@minecraft/server";
world.beforeEvents.worldInitialize.subscribe(initEvent => {
  initEvent.blockComponentRegistry.registerCustomComponent('we:tick_grass', {
    onRandomTick(e) {
      const {
        block
      } = e;

      const below = block.below();

      if (below.typeId !== 'minecraft:dirt') return;

      below.setType('minecraft:grass_block');

      
    }
  });
});