public enum Direction    {
        SOUTH(0),
        SOUTH_WEST(256),
        WEST(512),
        NORTH_WEST(768),
        NORTH(1024),
        NORTH_EAST(1280),
        EAST(1536),
        SOUTH_EAST(1792);
        
        private int index;
        
        Direction(int index)    {
            this.index = index;
        }
        
        public static String toString(int index)    {
            for (Direction d: values())    {
                if (index == d.index)
                    return d.name().replace("_", " ").toLowerCase();
            }
            return null;
        }
        
        public static String toString(Direction d)    {
            return d.name().replace("_", " ").toLowerCase();
        }
    }
You simply have to use my players "getRotation()"
  
example: 
log("" +Direction.toString(myPlayer().getRotation()));
pictures example: it wont let me add picture  
  
http://puu.sh/7nqGB 
  
http://puu.sh/7nqHw 
  
http://puu.sh/7nqI6