Alliance system: Each creature can be part of one or more teams. When two creatures have at least one team in common, they will not attack each other. Ghost players are never attacked by mobs.