Loyalty

Loyalty is an enchantment to a trident. When a trident enchanted with Loyalty is thrown and comes into contact with any block or entity, it returns to the player who threw it. Higher enchantments decrease the waiting time to return.

Throwing a trident into the Void effectively destroys the trident; it will never return because it hits no block or entity.

Loyalty and Riptide are mutually exclusive. If the two are combined via commands, Riptide will still function normally but the trident can no longer be thrown.