$(x,y,z)= (2n+1, 2n^2+2n, 2n^2+2n+1)$ is a primitive Pythagorean triplet with $z=y+1$ for any $n\in \mathbb N.$
$(x,y,z)=(4m', 4m'^2-1,4m'^2+1)$ is a primitive Pythagorean triplet with $z=y+2 $ for any $m'\in \mathbb N.$
Primitive triplets are all of the form $(m^2-n^2, 2mn,m^2+n^2)$ where $m,n$ are co-prime positive integers, not both odd, with $m>n.$ But we can change the order to $(2mn,m^2-n^2,m^2+n^2).$
For the first case we cannot have $1=(m^2+n^2)-(m^2-n^2)=2n^2$ but we can have $1=(m^2+n^2)-(2mn)=(m-n)^2$ if $m-n=1.$ So the solution in the first case is found by letting $m=n+1$ and $(x,y,z)=(m^2-n^2,2mn,m^2+n^2).$
For the second case we cannot have $2=(m^2+n^2)-(2mn)=(m-n)^2$ but we can have $2=(m^2+n^2)-(m^2-n^2)=2n^2$ if $n=1.$ If $n=1$ then m must be even so the solution in the second case is found by letting $m=2m'$ and $n=1$ and $(x,y,z)=(2mn,m^2-n^2,m^2+n^2).$