* @param pet The entity to check.
* @return true if the entity is friendly, false otherwise
*/
public static boolean isFriendlyPet(Player attacker, Tameable pet) {
if (pet.isTamed()) {
AnimalTamer tamer = pet.getOwner();
if (tamer instanceof Player) {
Player owner = (Player) tamer;
return (owner == attacker || PartyManager.inSameParty(attacker, owner) || PartyManager.areAllies(attacker, owner));