Loyalty is an enchantment in Minecraft that is applied to a trident and causes it to return to its owner once cast. If the player dies while the trident is being returned, the trident will fall into the form of an object and may disappear.
What is the purpose of the Loyalty enchantment
When a trident enchanted with Loyalty is cast and comes into contact with a block or entity, it returns after a period of time to the player who cast it. Higher level enchantments decrease the time it takes for it to return.
In the Java edition, throwing a trident into the void destroys it; it never returns because there are no blocks or entities to hit. In the Bedrock edition, the trident returns after traveling about 15 blocks in the void. A trident enchanted by Loyalty does not return when cast by a dispenser.
If commands are used to increase the enchantment level beyond 127, the enchantment no longer works.
The return speed of the trident depends on the level of the enchantment.
When the player moves between dimensions, the trident attempts to return to the player but stays in the current dimension. For example, if a player casts a trident enchanted with Loyalty while in the nether and travels to the outside world before the trident returns, the trident remains in the nether and does not disperse. As soon as the player returns to the nether, the trident resumes its path to the player.