ERC1155 custom mint function

Hi, welcome!

I think you can use the first way, just like:

YourERC1155 is ERC1155 {
    function YOUR_MINT(address to, uint256 id, uint256 amount, bytes memory data) public {
        YOUR_COMPLEX_LOGIC;
        _mint(to, id, amount, data);
    }
}