Confused (conditions)
* A confused creature can't take reactions. * On its turn a confused creature rolls a d8 to determine what it does. * On a 1 to 4, a confused creature does nothing. * On a 5 or 6, a confused creature takes no action or bonus action and uses all its movement to move in a randomly determined direction. * On a 7 or 8, a confused creature makes a melee attack against a randomly determined creature within its reach or does nothing if it can't make such an attack.
Source: Adventurer's Guide — official document