You can replicate this by placing boats around you. Mobs like Endermen, Piglins, etc, all get pulled into a one whenever treading nearby. This would be pretty funny actually, if it didn't afterwards trivialize combat because your foe is completely passified!
Hostile mobs should be unable to get into boats when aggroed and following a player. For instance, trapping Wardens with boats would be the quickest way to kill the vibe of the mob you're trying to sell.
Linked issues
Comments


The fact mobs like the enderman cannot teleport out it intended, see MC-3866. Any mob just not being able to leave is very likely intended as well - you mentioned the Warden: The Warden will definitely be too large to fit in a boat.

Huh. Well, alright! Thanks

Relates to [MC-150778].

Sooo this can be closed?

Affects 1.20.1.
⚠️ Please do not mark Unreleased Versions as affected. You don't have access to them yet.
-- I am a bot. This action was performed automatically! Please report any issues in Discord or Reddit