How can someone prevent others from taking/using their magic item?

Seems simple: you have a powerful item that you don’t want the BBEG to steal and destroy or use against you. Are there any effects you can apply to it via crafting that will help keep it in your possession or let you instantly take it back?

And if not, can you at least craft effects that cause harmful side-effects to wielders other than yourself (like how the life-drinker gives negative levels to wielders who aren’t undead/constructs) or make it weaker when others use it (like how the holy avenger has a lower enchantment bonus and fewer special abilities when used by non-paladins)?