onEvent('entity.spawned', (event) => {

    let entity = event.entity;

    if(entity.type == 'alexsmobs:void_portal'){

        var pos = [Math.round(entity.x), Math.round(entity.y), Math.round(entity.z)];
        var block = entity.world.getBlock(pos[0], pos[1], pos[2]);
        var itemEntity = block.createEntity('item');

        itemEntity.y+=0.8;
        itemEntity.x+=0.5;
        itemEntity.z+=0.5;
        itemEntity.item = Item.of('#forge:gems/dimensional');
        itemEntity.item.count = Math.round(Math.random())+2;
        itemEntity.pickupDelay = 10;
        itemEntity.motionY = 0.08;
        itemEntity.spawn();

    }

})