How to transfer purchased app from another apple id to a new phone?

Okay so last month my cousin downloaded minecraft on his phone (diff apple id) and I love minecraft lol so I made him download it on my phone too (I made him sign in on my phone).

But next week I'm getting an iphone 5, how can I transfer minecraft on it? Should I ask him again? Do I need to pay for it? I'm not sure if I could transfer it bc I'm using a different apple id

You need your cousin's apple id, in order to download it again. Just ask your cousin to put the information on your new iphone.

Ask your cousin for the info again I personally would write it down or something so that if you need to do it again you can without your cousins help.