Snortles is probably right. /pet attack allows you to input a specific target. Example: /pet attack a_sand_giant . Most likely having a space after /pet attack will cause the pet to go after whatever mob shows up first on the list of all mobs. I havent tested it myself to confirm this, but that is a likely cause.
|